org.acm.seguin.refactor.method
Class ExtractMethodRefactoring

java.lang.Object
  extended by org.acm.seguin.refactor.Refactoring
      extended by org.acm.seguin.refactor.method.ExtractMethodRefactoring

public class ExtractMethodRefactoring
extends Refactoring

Refactoring class that extracts a portion of the method and creates a new method with what the user has selected.

Version:
$Id: ExtractMethodRefactoring.java,v 1.7 2003/10/30 15:24:23 mikeatkinson Exp $
Author:
Chris Seguin, Mike Atkinson

Field Summary
static int PACKAGE
          The extracted method should have package scope
static int PRIVATE
          The extracted method should be private
static int PROTECTED
          The extracted method should have protected scope
static int PUBLIC
          The extracted method should have public scope
 
Fields inherited from class org.acm.seguin.refactor.Refactoring
ADD_CHILD, ADD_PARENT, EXTRACT_INTERFACE, EXTRACT_METHOD, MOVE_METHOD, PUSH_DOWN_FIELD, PUSH_DOWN_METHOD, PUSH_UP_ABSTRACT_METHOD, PUSH_UP_FIELD, PUSH_UP_METHOD, REMOVE_CLASS, RENAME_CLASS, RENAME_FIELD, RENAME_METHOD, RENAME_PARAMETER, REPACKAGE
 
Constructor Summary
protected ExtractMethodRefactoring()
          Constructor for the ExtractMethodRefactoring object
 
Method Summary
 java.lang.String getDescription()
          Gets the Description attribute of the ExtractMethodRefactoring object
 java.lang.String getFullFile()
          Gets the FullFile attribute of the ExtractMethodRefactoring object
 int getID()
          Gets the ID attribute of the ExtractMethodRefactoring object
 VariableSummary[] getParameters()
          Gets the Parameters attribute of the ExtractMethodRefactoring object
 java.lang.Object getReturnType()
          Gets the return type for the extracted method
 java.lang.Object[] getReturnTypes()
          Gets the possible return types
 java.lang.String getSignature()
          Gets the Signature attribute of the ExtractMethodRefactoring object
 boolean isStatement()
          Gets the Statement attribute of the ExtractMethodRefactoring object
protected  void preconditions()
          These items must be true before the refactoring will work
 void setFullFile(java.lang.String value)
          Sets the FullFile attribute of the ExtractMethodRefactoring object
 void setFullFile(java.lang.StringBuffer value)
          Sets the FullFile attribute of the ExtractMethodRefactoring object
 void setMethodName(java.lang.String value)
          Sets the MethodName attribute of the ExtractMethodRefactoring object
 void setParameterOrder(java.lang.Object[] data)
          Sets the order of the parameters
 void setProtection(int value)
          Sets the Protection attribute of the ExtractMethodRefactoring object
 void setReturnType(java.lang.Object obj)
          Sets the return type for the extracted method
 void setSelection(java.lang.String value)
          Sets the Selection attribute of the ExtractMethodRefactoring object
protected  void transform()
          Actually make the transformation
 
Methods inherited from class org.acm.seguin.refactor.Refactoring
checkDestinationFile, getComplexTransform, run, setComplexTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIVATE

public static final int PRIVATE
The extracted method should be private

See Also:
Constant Field Values

PACKAGE

public static final int PACKAGE
The extracted method should have package scope

See Also:
Constant Field Values

PROTECTED

public static final int PROTECTED
The extracted method should have protected scope

See Also:
Constant Field Values

PUBLIC

public static final int PUBLIC
The extracted method should have public scope

See Also:
Constant Field Values
Constructor Detail

ExtractMethodRefactoring

protected ExtractMethodRefactoring()
Constructor for the ExtractMethodRefactoring object

Method Detail

setFullFile

public void setFullFile(java.lang.String value)
Sets the FullFile attribute of the ExtractMethodRefactoring object

Parameters:
value - The new FullFile value

setFullFile

public void setFullFile(java.lang.StringBuffer value)
Sets the FullFile attribute of the ExtractMethodRefactoring object

Parameters:
value - The new FullFile value

setSelection

public void setSelection(java.lang.String value)
                  throws RefactoringException
Sets the Selection attribute of the ExtractMethodRefactoring object

Parameters:
value - The new Selection value
Throws:
RefactoringException

setMethodName

public void setMethodName(java.lang.String value)
Sets the MethodName attribute of the ExtractMethodRefactoring object

Parameters:
value - The new MethodName value

setParameterOrder

public void setParameterOrder(java.lang.Object[] data)
Sets the order of the parameters

Parameters:
data - The new ParameterOrder value

setProtection

public void setProtection(int value)
Sets the Protection attribute of the ExtractMethodRefactoring object

Parameters:
value - The new Protection value

setReturnType

public void setReturnType(java.lang.Object obj)
Sets the return type for the extracted method

Parameters:
obj - The new ReturnType value

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the ExtractMethodRefactoring object

Specified by:
getDescription in class Refactoring
Returns:
The Description value

getFullFile

public java.lang.String getFullFile()
Gets the FullFile attribute of the ExtractMethodRefactoring object

Returns:
The FullFile value

getParameters

public VariableSummary[] getParameters()
                                throws RefactoringException
Gets the Parameters attribute of the ExtractMethodRefactoring object

Returns:
The Parameters value
Throws:
RefactoringException - Description of Exception

getReturnTypes

public java.lang.Object[] getReturnTypes()
                                  throws RefactoringException
Gets the possible return types

Returns:
The return types
Throws:
RefactoringException - problem in loading these

isStatement

public boolean isStatement()
Gets the Statement attribute of the ExtractMethodRefactoring object

Returns:
The Statement value

getSignature

public java.lang.String getSignature()
Gets the Signature attribute of the ExtractMethodRefactoring object

Returns:
The Signature value

getReturnType

public java.lang.Object getReturnType()
Gets the return type for the extracted method

Returns:
The return type

getID

public int getID()
Gets the ID attribute of the ExtractMethodRefactoring object

Specified by:
getID in class Refactoring
Returns:
The ID value

preconditions

protected void preconditions()
                      throws RefactoringException
These items must be true before the refactoring will work

Specified by:
preconditions in class Refactoring
Throws:
RefactoringException - the problem that arose

transform

protected void transform()
Actually make the transformation

Specified by:
transform in class Refactoring