Composite Refactoring
v1.0

compositeRefactoring
Class RefactoringComponentFactory

java.lang.Object
  |
  +--compositeRefactoring.RefactoringComponentFactory

public class RefactoringComponentFactory
extends Object

RefactoringComponentFactory is a convenience class for creating simple RefactoringComponents. It takes the role of the org.eclipse.jdt.internal.ui.refactoring.* classes which prepare and create refactorings. It is also possible to create Refactorings without using RefactoringComponentFactory. There is also a static reference for the top-level RefactoringComponent for passing betweeen action classes.


Constructor Summary
RefactoringComponentFactory()
           
 
Method Summary
static void example_Iterator_Strategy()
          This is an example for the composition of Refactorings.
static void example_List_Strategy()
          This is an example for the composition of Refactorings.
static RefactoringComponent getRefactoringComponent()
          Returns the static reference of a RefactoringComponent.
static RefactoringComponent newPullUpMethodRefactoring(IMethod[] members)
          creates a RefactoringComponent representing a PullUpRefactoring for a method.
static RefactoringComponent newRenameFieldRefactoring(IField field, String newName)
          creates a RefactoringComponent representing a RenameFieldRefactoring.
static RefactoringComponent newRenameMethodRefactoring(IMethod method, String newName)
          creates a RefactoringComponent representing a RenameMethodRefactoring.
static RefactoringComponent newRenameTypeRefactoring(IType type, String newName)
          creates a RefactoringComponent representing a RenameTypeRefactoring.
static void setRefactoringComponent(RefactoringComponent comp)
          Sets a static reference to a RefactoringComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefactoringComponentFactory

public RefactoringComponentFactory()
Method Detail

setRefactoringComponent

public static void setRefactoringComponent(RefactoringComponent comp)
Sets a static reference to a RefactoringComponent.
Parameters:
comp - the RefactoringComponent to be set.

getRefactoringComponent

public static RefactoringComponent getRefactoringComponent()
Returns the static reference of a RefactoringComponent.
Returns:
the RefactoringComponent reference.

example_List_Strategy

public static void example_List_Strategy()
This is an example for the composition of Refactorings. It works on a project called Cars, which is located in the workspace of Eclipse. Here, the composition is accomplished with a list.

example_Iterator_Strategy

public static void example_Iterator_Strategy()
This is an example for the composition of Refactorings. It works on a project called Cars, which is located in the workspace of Eclipse. Here, the composition is accomplished with an iterator strategy.

newRenameTypeRefactoring

public static RefactoringComponent newRenameTypeRefactoring(IType type,
                                                            String newName)
creates a RefactoringComponent representing a RenameTypeRefactoring.
Parameters:
type - the type to be renamed.
newName - the new name of the type.
Returns:
the RefactoringComponent enclosing the RenameTypeRefactoring.

newRenameFieldRefactoring

public static RefactoringComponent newRenameFieldRefactoring(IField field,
                                                             String newName)
creates a RefactoringComponent representing a RenameFieldRefactoring.
Parameters:
field - the field to be renamed.
newName - the new name of the type.
Returns:
the RefactoringComponent enclosing the RenameFieldRefactoring.

newRenameMethodRefactoring

public static RefactoringComponent newRenameMethodRefactoring(IMethod method,
                                                              String newName)
creates a RefactoringComponent representing a RenameMethodRefactoring.
Parameters:
method - the method to be renamed.
newName - the new name of the type.
Returns:
the RefactoringComponent enclosing the RenameTMethodRefactoring.

newPullUpMethodRefactoring

public static RefactoringComponent newPullUpMethodRefactoring(IMethod[] members)
creates a RefactoringComponent representing a PullUpRefactoring for a method.
Parameters:
members - the methods to be pulled up. The array's first entry will be pulled up. All other entries will be deleted (it is assumed that all members are the same methods but in different classes with the same superclass).
Returns:
the RefactoringComponent enclosing the RenameTypeRefactoring.

Composite Refactoring
v1.0