| org.eclipse.jdt.internal.corext.refactoring.code.ScriptableRefactoring org.eclipse.jdt.internal.corext.refactoring.code.IntroduceFactoryRefactoring
IntroduceFactoryRefactoring | public class IntroduceFactoryRefactoring extends ScriptableRefactoring (Code) | | Refactoring class that permits the substitution of a factory method
for direct calls to a given constructor.
author: rfuhrer |
Method Summary | |
public boolean | canProtectConstructor() Returns true iff the selected constructor can be protected. | public RefactoringStatus | checkFinalConditions(IProgressMonitor pm) | public RefactoringStatus | checkInitialConditions(IProgressMonitor pm) | public Change | createChange(IProgressMonitor pm) | public String | getFactoryClassName() Returns the name of the class on which the generated factory method is
to be placed. | public String | getName() | public String | getNewMethodName() Returns the name to be used for the generated factory method. | public IJavaProject | getProject() Returns the project on behalf of which this refactoring was invoked. | public RefactoringStatus | initialize(RefactoringArguments arguments) | public RefactoringStatus | setFactoryClass(String fullyQualifiedTypeName) Sets the class on which the generated factory method is to be placed. | public RefactoringStatus | setNewMethodName(String newMethodName) Sets the name to be used for the generated factory method.
Returns a RefactoringStatus that indicates whether the
given name is valid for the new factory method. | public void | setProtectConstructor(boolean protectConstructor) If the argument is true, change the visibility of the constructor to
protected , thereby encapsulating it. |
IntroduceFactoryRefactoring | public IntroduceFactoryRefactoring(ICompilationUnit cu, int selectionStart, int selectionLength)(Code) | | Creates a new IntroduceFactoryRefactoring with the given selection
on the given compilation unit.
Parameters: cu - the ICompilationUnit in which the user selection was made, or null if invoked from scripting Parameters: selectionStart - the start of the textual selection in cu Parameters: selectionLength - the length of the textual selection in cu |
canProtectConstructor | public boolean canProtectConstructor()(Code) | | Returns true iff the selected constructor can be protected.
return true if the constructor can be made protected |
checkFinalConditions | public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException(Code) | | |
checkInitialConditions | public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException(Code) | | |
createChange | public Change createChange(IProgressMonitor pm) throws CoreException(Code) | | |
getFactoryClassName | public String getFactoryClassName()(Code) | | Returns the name of the class on which the generated factory method is
to be placed.
return the factory class name |
getNewMethodName | public String getNewMethodName()(Code) | | Returns the name to be used for the generated factory method.
the new method name |
getProject | public IJavaProject getProject()(Code) | | Returns the project on behalf of which this refactoring was invoked.
returns the Java project |
initialize | public RefactoringStatus initialize(RefactoringArguments arguments)(Code) | | |
setFactoryClass | public RefactoringStatus setFactoryClass(String fullyQualifiedTypeName)(Code) | | Sets the class on which the generated factory method is to be placed.
Parameters: fullyQualifiedTypeName - an IType referring to an existing class return the resulting status |
setNewMethodName | public RefactoringStatus setNewMethodName(String newMethodName)(Code) | | Sets the name to be used for the generated factory method.
Returns a RefactoringStatus that indicates whether the
given name is valid for the new factory method.
Parameters: newMethodName - the name to be used for the generated factory method the resulting status |
setProtectConstructor | public void setProtectConstructor(boolean protectConstructor)(Code) | | If the argument is true, change the visibility of the constructor to
protected , thereby encapsulating it.
Parameters: protectConstructor - |
|
|