Eclipse JDT
Release 3.7

org.eclipse.jdt.core.refactoring.descriptors
Class IntroduceParameterObjectDescriptor.Parameter

java.lang.Object
  extended by org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.Parameter
Enclosing class:
IntroduceParameterObjectDescriptor

public static class IntroduceParameterObjectDescriptor.Parameter
extends Object

Instances of Parameter are used to describe the position of parameter and fields.


Constructor Summary
IntroduceParameterObjectDescriptor.Parameter(int index)
          Creates a new parameter object.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntroduceParameterObjectDescriptor.Parameter

public IntroduceParameterObjectDescriptor.Parameter(int index)
Creates a new parameter object. It is not recommended to call this constructor directly. Use IntroduceParameterObjectDescriptor.createParameters(IMethod) instead.

Parameters:
index - the index of the parameter in the method
Method Detail

getFieldName

public String getFieldName()
The name of the field that will be created if isCreateField() is true

Returns:
the field name
See Also:
isCreateField(), setFieldName(String)

getIndex

public int getIndex()
The index of the parameter in the original method signature. The parameter object has the special index IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX. The position in the new method signature depends on the position in the array passed to IntroduceParameterObjectDescriptor.setParameters(IntroduceParameterObjectDescriptor.Parameter[])

Returns:
returns the index of the parameter in the original method signature or IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX for the parameter object
See Also:
IntroduceParameterObjectDescriptor.PARAMETER_OBJECT, IntroduceParameterObjectDescriptor.PARAMETER_OBJECT_IDX, IntroduceParameterObjectDescriptor.setParameters(IntroduceParameterObjectDescriptor.Parameter[])

isCreateField

public boolean isCreateField()
If true the parameter will be removed from the method's signature and will be added to the parameter object. The default is false

Returns:
true if the parameter will be created as field, false if 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 is false. Changing the creatField property of the parameter object will throw a IllegalArgumentException

Parameters:
createField - true if the parameter should be created as field, false if it will remain in the method

setFieldName

public void setFieldName(String fieldName)
Sets the name of the field that will be created in the parameter object if isCreateField() is true. Changing the fieldName of the parameter object will throw a IllegalArgumentException

Parameters:
fieldName - the new name of the field. A null indicates that the field name should be automatically derived
See Also:
isCreateField()

Eclipse JDT
Release 3.7

Guidelines for using Eclipse APIs.

Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.