public static class IntroduceParameterObjectDescriptor.Parameter extends Object
Constructor and Description |
---|
Parameter(int index)
Creates a new parameter object.
|
Modifier and Type | Method and Description |
---|---|
String |
getFieldName()
The name of the field that will be created if
isCreateField() is true |
int |
getIndex()
The index of the parameter in the original method signature.
|
boolean |
isCreateField()
If
true the parameter will be removed from the method's signature and will be added
to the parameter object. |
void |
setCreateField(boolean createField)
Sets whether the parameter will be removed from the method's signature or will be added to the parameter object.
|
void |
setFieldName(String fieldName)
Sets the name of the field that will be created in the parameter object if
isCreateField()
is true . |
public Parameter(int index)
IntroduceParameterObjectDescriptor.createParameters(IMethod)
instead.index
- the index of the parameter in the methodpublic String getFieldName()
isCreateField()
is true
isCreateField()
,
setFieldName(String)
public int getIndex()
IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX
.
The position in the new method signature depends on the position in the array passed to IntroduceParameterObjectDescriptor.setParameters(IntroduceParameterObjectDescriptor.Parameter[])
IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX
for the parameter objectIntroduceParameterObjectDescriptor.PARAMETER_OBJECT
,
IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX
,
IntroduceParameterObjectDescriptor.setParameters(IntroduceParameterObjectDescriptor.Parameter[])
public boolean isCreateField()
true
the parameter will be removed from the method's signature and will be added
to the parameter object. The default is false
true
if the parameter will be created as field, false
if
it will remain in the methodpublic void setCreateField(boolean createField)
false
. Changing the creatField property of the parameter object will throw a IllegalArgumentException
createField
- true
if the parameter should be created as field, false
if it will remain in the methodpublic void setFieldName(String fieldName)
isCreateField()
is true
. Changing the fieldName of the parameter object will throw a IllegalArgumentException
fieldName
- the new name of the field. A null
indicates that the field name should be automatically derivedisCreateField()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.