Class IntroduceParameterObjectDescriptor.Parameter
java.lang.Object
org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.Parameter
- Enclosing class:
IntroduceParameterObjectDescriptor
Instances of Parameter are used to describe the position of parameter and fields.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe name of the field that will be created ifisCreateField()istrueintgetIndex()The index of the parameter in the original method signature.booleanIftruethe parameter will be removed from the method's signature and will be added to the parameter object.voidsetCreateField(boolean createField) Sets whether the parameter will be removed from the method's signature or will be added to the parameter object.voidsetFieldName(String fieldName) Sets the name of the field that will be created in the parameter object ifisCreateField()istrue.
-
Constructor Details
-
Parameter
public Parameter(int index) Creates a new parameter object. It is not recommended to call this constructor directly. UseIntroduceParameterObjectDescriptor.createParameters(IMethod)instead.- Parameters:
index- the index of the parameter in the method
-
-
Method Details
-
getFieldName
The name of the field that will be created ifisCreateField()istrue- Returns:
- the field name
- See Also:
-
getIndex
public int getIndex()The index of the parameter in the original method signature. The parameter object has the special indexIntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX. The position in the new method signature depends on the position in the array passed toIntroduceParameterObjectDescriptor.setParameters(IntroduceParameterObjectDescriptor.Parameter[])- Returns:
- returns the index of the parameter in the original method signature or
IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDXfor the parameter object - See Also:
-
isCreateField
public boolean isCreateField()Iftruethe parameter will be removed from the method's signature and will be added to the parameter object. The default isfalse- Returns:
trueif the parameter will be created as field,falseif it will remain in the method
-
setCreateField
public void setCreateField(boolean createField) Sets whether the parameter will be removed from the method's signature or will be added to the parameter object. The default isfalse. Changing the creatField property of the parameter object will throw aIllegalArgumentException- Parameters:
createField-trueif the parameter should be created as field,falseif it will remain in the method
-
setFieldName
Sets the name of the field that will be created in the parameter object ifisCreateField()istrue. Changing the fieldName of the parameter object will throw aIllegalArgumentException- Parameters:
fieldName- the new name of the field. Anullindicates that the field name should be automatically derived- See Also:
-