|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acm.seguin.refactor.Refactoring
public abstract class Refactoring
Adds a class that is either a parent or a child of an existing class.
Field Summary | |
---|---|
static int |
ADD_CHILD
The add child refactoring |
static int |
ADD_PARENT
The add parent refactoring |
static int |
EXTRACT_INTERFACE
Extracts the interface |
static int |
EXTRACT_METHOD
Extracts code from one method to create a new method |
static int |
MOVE_METHOD
Moves the method into another class |
static int |
PUSH_DOWN_FIELD
Pushes the field into the parent class |
static int |
PUSH_DOWN_METHOD
Pushes the method into the child classes |
static int |
PUSH_UP_ABSTRACT_METHOD
Pushes the method signature into the parent class |
static int |
PUSH_UP_FIELD
Pushes the field into the child classes |
static int |
PUSH_UP_METHOD
Pushes the method into the parent class |
static int |
REMOVE_CLASS
The remove class refactoring |
static int |
RENAME_CLASS
The rename class refactoring |
static int |
RENAME_FIELD
Renames the field |
static int |
RENAME_METHOD
Extracts code from one method to create a new method |
static int |
RENAME_PARAMETER
Renames a parameter |
static int |
REPACKAGE
The repackage refactoring |
Constructor Summary | |
---|---|
Refactoring()
Constructor for the Refactoring object |
Method Summary | |
---|---|
protected void |
checkDestinationFile(Summary loop,
java.lang.String message)
Check that we are allowed to adjust the destination |
protected ComplexTransform |
getComplexTransform()
Gets a complex transform object for this refactoring |
abstract java.lang.String |
getDescription()
Gets the description of the refactoring |
abstract int |
getID()
Gets the id for this refactoring to track which refactorings are used. |
protected abstract void |
preconditions()
Describes the preconditions that must be true for this refactoring to be applied |
void |
run()
Main program that performst the transformation |
static void |
setComplexTransform(java.lang.Class complexTransform)
This sets the class that does complex transforms. |
protected abstract void |
transform()
Performs the transform on the rest of the classes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int REPACKAGE
public static final int RENAME_CLASS
public static final int ADD_CHILD
public static final int ADD_PARENT
public static final int REMOVE_CLASS
public static final int EXTRACT_INTERFACE
public static final int PUSH_DOWN_FIELD
public static final int PUSH_UP_FIELD
public static final int RENAME_FIELD
public static final int PUSH_UP_METHOD
public static final int PUSH_UP_ABSTRACT_METHOD
public static final int PUSH_DOWN_METHOD
public static final int MOVE_METHOD
public static final int EXTRACT_METHOD
public static final int RENAME_METHOD
public static final int RENAME_PARAMETER
Constructor Detail |
---|
public Refactoring()
Method Detail |
---|
public abstract java.lang.String getDescription()
public abstract int getID()
public void run() throws RefactoringException
RefactoringException
- Description of Exceptionpublic static void setComplexTransform(java.lang.Class complexTransform) throws java.lang.IllegalArgumentException
complexTransform
- a class that implements org.acm.seguin.refactor.ComplexTransform
java.lang.IllegalArgumentException
- if the class cannot be instantiated or does not implement ComplexTransformprotected ComplexTransform getComplexTransform()
protected abstract void preconditions() throws RefactoringException
RefactoringException
- thrown if one or more of the
preconditions is not satisfied. The text of the exception provides a
hint of what went wrong.protected abstract void transform()
protected void checkDestinationFile(Summary loop, java.lang.String message) throws RefactoringException
loop
- the summarymessage
- the message
RefactoringException
- problem report
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |