Java Doc for MoveInstanceMethodProcessor.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » corext » refactoring » structure » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.internal.corext.refactoring.structure 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor

MoveInstanceMethodProcessor
final public class MoveInstanceMethodProcessor extends MoveProcessor implements IScriptableRefactoring,IDelegateUpdating,ICommentProvider(Code)
Refactoring processor to move instance methods.

Inner Class :final public class AnonymousClassReferenceFinder extends AstNodeFinder
Inner Class :protected static class AstNodeFinder extends ASTVisitor
Inner Class :class DelegateInstanceMethodCreator extends DelegateMethodCreator
Inner Class :final public class EnclosingInstanceReferenceFinder extends AstNodeFinder
Inner Class :final public class GenericReferenceFinder extends AstNodeFinder
Inner Class :protected static interface IArgumentFactory
Inner Class :final public class MethodBodyRewriter extends ASTVisitor
Inner Class :public static class ReadyOnlyFieldFinder extends ASTVisitor
Inner Class :final public class RecursiveCallFinder extends AstNodeFinder
Inner Class :final public class SuperReferenceFinder extends AstNodeFinder
Inner Class :final public class ThisReferenceFinder extends AstNodeFinder
Inner Class :public class VisibilityAdjustingArgumentFactory implements IArgumentFactory

Field Summary
final public static  StringIDENTIFIER
    

Constructor Summary
public  MoveInstanceMethodProcessor(IMethod method, CodeGenerationSettings settings)
     Creates a new move instance method processor.

Method Summary
public  booleancanEnableComment()
    
final public  booleancanEnableDelegateUpdating()
    
protected  voidcheckConflictingMethod(IProgressMonitor monitor, RefactoringStatus status)
     Checks whether a method with the proposed name already exists in the target type.
protected  voidcheckConflictingTarget(IProgressMonitor monitor, RefactoringStatus status)
     Checks whether the new target name conflicts with an already existing method parameter.
final public  RefactoringStatuscheckFinalConditions(IProgressMonitor monitor, CheckConditionsContext context)
    
protected  voidcheckGenericTarget(IProgressMonitor monitor, RefactoringStatus status)
     Checks whether the target is a type variable or a generic type.
protected  voidcheckGenericTypes(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)
     Checks whether the method has references to type variables or generic types.
final public  RefactoringStatuscheckInitialConditions(IProgressMonitor monitor)
    
protected  voidcheckMethodBody(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)
     Checks whether the instance method body is compatible with this refactoring.
protected  voidcheckMethodDeclaration(IProgressMonitor monitor, RefactoringStatus status)
     Checks whether the instance method declaration is compatible with this refactoring.
protected  voidcheckPossibleTargets(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)
    
protected  SearchResultGroup[]computeMethodReferences(IProgressMonitor monitor, RefactoringStatus status)
     Searches for references to the original method.
protected  IFile[]computeModifiedFiles(ICompilationUnit source, ICompilationUnit target)
     Computes the files that are being modified by this refactoring.
protected  String[]computeReservedIdentifiers()
     Returns the reserved identifiers in the method to move.
protected  IVariableBinding[]computeTargetCategories(MethodDeclaration declaration)
     Computes the target categories for the method to move.
protected  ExpressioncreateAdjustedTargetExpression(IJavaElement enclosingElement, Expression expression, Map adjustments, ASTRewrite rewrite)
     Creates a visibility-adjusted target expression taking advantage of existing accessor methods.
protected  booleancreateArgumentList(MethodDeclaration declaration, List arguments, IArgumentFactory factory)
    
final public  ChangecreateChange(IProgressMonitor monitor)
    
protected  TextChangeManagercreateChangeManager(RefactoringStatus status, IProgressMonitor monitor)
     Creates the text change manager for this processor.
protected  booleancreateInlinedMethodInvocation(CompilationUnitRewrite rewriter, MethodDeclaration declaration, SearchMatch match, Map adjustments, boolean target, RefactoringStatus status)
     Creates the necessary change to inline a method invocation represented by a search match.
protected  ExpressioncreateInlinedTargetExpression(CompilationUnitRewrite rewriter, IJavaElement enclosingElement, Expression original, Map adjustments, RefactoringStatus status)
     Creates the target field expression for the inline method invocation.
protected  booleancreateMethodArguments(Map rewrites, ASTRewrite rewrite, MethodDeclaration declaration, Map adjustments, RefactoringStatus status)
     Creates the method arguments for the target method declaration.
protected  voidcreateMethodBody(CompilationUnitRewrite rewriter, ASTRewrite rewrite, MethodDeclaration declaration)
     Creates the method body for the target method declaration.
protected  voidcreateMethodComment(ASTRewrite rewrite, MethodDeclaration declaration)
     Creates the method comment for the target method declaration.
protected  StringcreateMethodContent(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite)
     Creates the method content of the moved method.
protected  booleancreateMethodCopy(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite, Map rewrites, Map adjustments, RefactoringStatus status, IProgressMonitor monitor)
     Creates the necessary changes to create the delegate method with the original method body.
protected  booleancreateMethodDelegation(MethodDeclaration declaration, Map rewrites, Map adjustments, RefactoringStatus status, IProgressMonitor monitor)
     Creates the necessary changes to replace the body of the method declaration with an expression to invoke the delegate.
protected  booleancreateMethodDelegator(Map rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, Map adjustments, boolean target, RefactoringStatus status, IProgressMonitor monitor)
     Creates the necessary changes to inline the method invocations to the original method.
protected  voidcreateMethodImports(CompilationUnitRewrite rewrite, MethodDeclaration declaration, IProgressMonitor monitor, RefactoringStatus status)
     Creates the necessary imports for the copied method in the target compilation unit.
protected  voidcreateMethodJavadocReference(CompilationUnitRewrite rewrite, MethodDeclaration declaration, SearchMatch match, boolean targetNode, RefactoringStatus status)
     Creates the necessary change to updated a comment reference represented by a search match.
protected  voidcreateMethodJavadocReferences(Map rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, boolean target, RefactoringStatus status, IProgressMonitor monitor)
     Creates the necessary changes to update tag references to the original method.
protected  ASTNodecreateMethodReference(MethodDeclaration declaration, AST ast)
    
protected  voidcreateMethodSignature(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite, Map rewrites)
    
protected  voidcreateMethodTypeParameters(ASTRewrite rewrite, MethodDeclaration declaration, RefactoringStatus status)
     Creates the necessary changes to remove method type parameters if they match with enclosing type parameters.
protected  ExpressioncreateSimpleTargetAccessExpression(MethodDeclaration declaration)
     Creates the expression to access the new target.
protected static  IVariableBinding[]getArgumentBindings(MethodDeclaration declaration)
     Returns the bindings of the method arguments of the specified declaration.
protected static  ITypeBinding[]getArgumentTypes(MethodDeclaration declaration)
     Returns the bindings of the method argument types of the specified declaration.
final public  IVariableBinding[]getCandidateTargets()
     Returns the candidate targets for the method to move.
public  StringgetComment()
    
protected  CompilationUnitRewritegetCompilationUnitRewrite(Map rewrites, ICompilationUnit unit)
     Returns a compilation unit rewrite for the specified compilation unit.
final public  booleangetDelegateUpdating()
    
public  StringgetDelegateUpdatingTitle(boolean plural)
    
final public  booleangetDeprecateDelegates()
    
final public  Object[]getElements()
    
final public  StringgetIdentifier()
    
final public  IMethodgetMethod()
     Returns the method to be moved.
final public  StringgetMethodName()
     Returns the new method name.
final public  IVariableBinding[]getPossibleTargets()
     Returns the possible targets for the method to move.
final public  StringgetProcessorName()
    
final protected  intgetTargetIndex()
     Returns the index of the chosen target.
final public  StringgetTargetName()
     Returns the new target name.
protected  ITypegetTargetType()
     Returns the type of the new target.
protected  voidinitialize(IMethod method)
     Initializes the refactoring with the given input.
public  RefactoringStatusinitialize(RefactoringArguments arguments)
    
final public  booleanisApplicable()
    
protected static  booleanisFieldAccess(SimpleName name)
    
protected  booleanisTargetAccess(Name name)
    
final public  RefactoringParticipant[]loadParticipants(RefactoringStatus status, SharableParticipants participants)
    
final public  booleanneedsTargetNode()
    
public  voidsetComment(String comment)
    
final public  voidsetDelegateUpdating(boolean updating)
    
final public  voidsetDeprecateDelegates(boolean deprecate)
    
final public  voidsetInlineDelegator(boolean inline)
     Determines whether the delegator has to be inlined.
final public  RefactoringStatussetMethodName(String name)
     Sets the new method name.
final public  voidsetRemoveDelegator(boolean remove)
     Determines whether the delegator has to be removed after inlining.
final public  voidsetTarget(IVariableBinding target)
     Sets the new target.
final public  RefactoringStatussetTargetName(String name)
     Sets the new target name.
final public  voidsetUseGetters(boolean use)
     Determines whether getter methods should be used to resolve visibility issues.
final public  voidsetUseSetters(boolean use)
     Determines whether setter methods should be used to resolve visibility issues.
final public  booleanshouldUseGetters()
    
final public  booleanshouldUseSetters()
    
protected  StringsuggestTargetName()
     Returns a best guess for the name of the new target.

Field Detail
IDENTIFIER
final public static String IDENTIFIER(Code)
The identifier of this processor




Constructor Detail
MoveInstanceMethodProcessor
public MoveInstanceMethodProcessor(IMethod method, CodeGenerationSettings settings)(Code)
Creates a new move instance method processor.
Parameters:
  method - the method to move, or null if invoked byscripting
Parameters:
  settings - the code generation settings to apply, or nullif invoked by scripting




Method Detail
canEnableComment
public boolean canEnableComment()(Code)



canEnableDelegateUpdating
final public boolean canEnableDelegateUpdating()(Code)



checkConflictingMethod
protected void checkConflictingMethod(IProgressMonitor monitor, RefactoringStatus status) throws JavaModelException(Code)
Checks whether a method with the proposed name already exists in the target type.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  status - the status of the condition checking
throws:
  JavaModelException - if the declared methods of the target type could not beretrieved



checkConflictingTarget
protected void checkConflictingTarget(IProgressMonitor monitor, RefactoringStatus status) throws JavaModelException(Code)
Checks whether the new target name conflicts with an already existing method parameter.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  status - the status of the condition checking
throws:
  JavaModelException - if the method declaration of the method to move could not befound



checkFinalConditions
final public RefactoringStatus checkFinalConditions(IProgressMonitor monitor, CheckConditionsContext context) throws CoreException, OperationCanceledException(Code)



checkGenericTarget
protected void checkGenericTarget(IProgressMonitor monitor, RefactoringStatus status)(Code)
Checks whether the target is a type variable or a generic type.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  status - the refactoring status



checkGenericTypes
protected void checkGenericTypes(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)(Code)
Checks whether the method has references to type variables or generic types.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  declaration - the method declaration to check for generic types
Parameters:
  status - the status of the condition checking



checkInitialConditions
final public RefactoringStatus checkInitialConditions(IProgressMonitor monitor) throws CoreException, OperationCanceledException(Code)



checkMethodBody
protected void checkMethodBody(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)(Code)
Checks whether the instance method body is compatible with this refactoring.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  declaration - the method declaration whose body to check
Parameters:
  status - the status of the condition checking



checkMethodDeclaration
protected void checkMethodDeclaration(IProgressMonitor monitor, RefactoringStatus status) throws JavaModelException(Code)
Checks whether the instance method declaration is compatible with this refactoring.
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  status - the status of the condition checking
throws:
  JavaModelException - if the method does not exist



checkPossibleTargets
protected void checkPossibleTargets(IProgressMonitor monitor, MethodDeclaration declaration, RefactoringStatus status)(Code)
Checks whether the method has possible targets to be moved to
Parameters:
  monitor - the progress monitor to display progress
Parameters:
  declaration - the method declaration to check
Parameters:
  status - the status of the condition checking



computeMethodReferences
protected SearchResultGroup[] computeMethodReferences(IProgressMonitor monitor, RefactoringStatus status) throws CoreException(Code)
Searches for references to the original method.
Parameters:
  monitor - the progress monitor to use
Parameters:
  status - the refactoring status to use the array of search result groups
throws:
  CoreException - if an error occurred during search



computeModifiedFiles
protected IFile[] computeModifiedFiles(ICompilationUnit source, ICompilationUnit target)(Code)
Computes the files that are being modified by this refactoring.
Parameters:
  source - the source compilation unit
Parameters:
  target - the target compilation unit the modified files



computeReservedIdentifiers
protected String[] computeReservedIdentifiers() throws JavaModelException(Code)
Returns the reserved identifiers in the method to move. the reserved identifiers
throws:
  JavaModelException - if the method declaration could not be found



computeTargetCategories
protected IVariableBinding[] computeTargetCategories(MethodDeclaration declaration)(Code)
Computes the target categories for the method to move.
Parameters:
  declaration - the method declaration the possible targets as variable bindings of read-only fields andparameters



createAdjustedTargetExpression
protected Expression createAdjustedTargetExpression(IJavaElement enclosingElement, Expression expression, Map adjustments, ASTRewrite rewrite) throws JavaModelException(Code)
Creates a visibility-adjusted target expression taking advantage of existing accessor methods.
Parameters:
  enclosingElement - the java element which encloses the current method access.
Parameters:
  expression - the expression to access the target, or null
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  rewrite - the ast rewrite to use an adjusted target expression, or null if theaccess did not have to be changed
throws:
  JavaModelException - if an error occurs while accessing the target expression



createArgumentList
protected boolean createArgumentList(MethodDeclaration declaration, List arguments, IArgumentFactory factory) throws JavaModelException(Code)
Creates a generic argument list of the refactored moved method
Parameters:
  declaration - the method declaration of the method to move
Parameters:
  arguments - the argument list to create
Parameters:
  factory - the argument factory to use true if a target node had to be inserted as firstargument, false otherwise
throws:
  JavaModelException - if an error occurs



createChange
final public Change createChange(IProgressMonitor monitor) throws CoreException, OperationCanceledException(Code)



createChangeManager
protected TextChangeManager createChangeManager(RefactoringStatus status, IProgressMonitor monitor) throws JavaModelException, CoreException(Code)
Creates the text change manager for this processor.
Parameters:
  status - the refactoring status
Parameters:
  monitor - the progress monitor to display progress the created text change manager
throws:
  JavaModelException - if the method declaration could not be found
throws:
  CoreException - if the changes could not be generated



createInlinedMethodInvocation
protected boolean createInlinedMethodInvocation(CompilationUnitRewrite rewriter, MethodDeclaration declaration, SearchMatch match, Map adjustments, boolean target, RefactoringStatus status) throws JavaModelException(Code)
Creates the necessary change to inline a method invocation represented by a search match.
Parameters:
  rewriter - the current compilation unit rewrite
Parameters:
  declaration - the source method declaration
Parameters:
  match - the search match representing the method invocation
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  target - true if a target node had to be inserted asfirst argument, false otherwise
Parameters:
  status - the refactoring status true if the inline change could be performed,false otherwise
throws:
  JavaModelException - if a problem occurred while creating the inlined targetexpression for field targets



createInlinedTargetExpression
protected Expression createInlinedTargetExpression(CompilationUnitRewrite rewriter, IJavaElement enclosingElement, Expression original, Map adjustments, RefactoringStatus status) throws JavaModelException(Code)
Creates the target field expression for the inline method invocation.
Parameters:
  rewriter - the current compilation unit rewrite
Parameters:
  enclosingElement - the enclosing java element of the method invocation.
Parameters:
  original - the original method invocation expression
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  status - the refactoring statusreturns the target expression
throws:
  JavaModelException - if a problem occurred while retrieving potential gettermethods of the target



createMethodArguments
protected boolean createMethodArguments(Map rewrites, ASTRewrite rewrite, MethodDeclaration declaration, Map adjustments, RefactoringStatus status) throws JavaModelException(Code)
Creates the method arguments for the target method declaration.
Parameters:
  rewrites - the compilation unit rewrites
Parameters:
  rewrite - the source ast rewrite
Parameters:
  declaration - the source method declaration
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  status - the refactoring status true if a target node had to be inserted as methodargument, false otherwise
throws:
  JavaModelException - if an error occurs while accessing the types of the arguments



createMethodBody
protected void createMethodBody(CompilationUnitRewrite rewriter, ASTRewrite rewrite, MethodDeclaration declaration)(Code)
Creates the method body for the target method declaration.
Parameters:
  rewriter - the target compilation unit rewrite
Parameters:
  rewrite - the source ast rewrite
Parameters:
  declaration - the source method declaration



createMethodComment
protected void createMethodComment(ASTRewrite rewrite, MethodDeclaration declaration) throws JavaModelException(Code)
Creates the method comment for the target method declaration.
Parameters:
  rewrite - the source ast rewrite
Parameters:
  declaration - the source method declaration
throws:
  JavaModelException - if the argument references could not be generated



createMethodContent
protected String createMethodContent(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite) throws BadLocationException(Code)
Creates the method content of the moved method.
Parameters:
  document - the document representing the source compilation unit
Parameters:
  declaration - the source method declaration
Parameters:
  rewrite - the ast rewrite to use the string representing the moved method body
throws:
  BadLocationException - if an offset into the document is invalid



createMethodCopy
protected boolean createMethodCopy(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite, Map rewrites, Map adjustments, RefactoringStatus status, IProgressMonitor monitor) throws CoreException(Code)
Creates the necessary changes to create the delegate method with the original method body.
Parameters:
  document - the buffer containing the source of the source compilationunit
Parameters:
  declaration - the method declaration to use as source
Parameters:
  rewrite - the ast rewrite to use for the copy of the method body
Parameters:
  rewrites - the compilation unit rewrites
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  status - the refactoring status
Parameters:
  monitor - the progress monitor to display progress
throws:
  CoreException - if an error occurs true if a target node had to be inserted as firstargument, false otherwise



createMethodDelegation
protected boolean createMethodDelegation(MethodDeclaration declaration, Map rewrites, Map adjustments, RefactoringStatus status, IProgressMonitor monitor) throws CoreException(Code)
Creates the necessary changes to replace the body of the method declaration with an expression to invoke the delegate.
Parameters:
  declaration - the method declaration to replace its body
Parameters:
  rewrites - the compilation unit rewrites
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  status - the refactoring status
Parameters:
  monitor - the progress monitor to display progress
throws:
  CoreException - if the change could not be generated true if a target node had to be inserted as firstargument, false otherwise



createMethodDelegator
protected boolean createMethodDelegator(Map rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, Map adjustments, boolean target, RefactoringStatus status, IProgressMonitor monitor)(Code)
Creates the necessary changes to inline the method invocations to the original method.
Parameters:
  rewrites - the map of compilation units to compilation unit rewrites
Parameters:
  declaration - the source method declaration
Parameters:
  groups - the search result groups representing all references to themoved method, including references in comments
Parameters:
  adjustments - the map of elements to visibility adjustments
Parameters:
  target - true if a target node must be inserted as firstargument, false otherwise
Parameters:
  status - the refactoring status
Parameters:
  monitor - the progress monitor to use true if all method invocations to the originalmethod declaration could be inlined, falseotherwise



createMethodImports
protected void createMethodImports(CompilationUnitRewrite rewrite, MethodDeclaration declaration, IProgressMonitor monitor, RefactoringStatus status) throws CoreException(Code)
Creates the necessary imports for the copied method in the target compilation unit.
Parameters:
  rewrite - the target compilation unit rewrite
Parameters:
  declaration - the source method declaration
Parameters:
  monitor - the progress monitor to use
Parameters:
  status - the refactoring status to use
throws:
  CoreException - if an error occurs



createMethodJavadocReference
protected void createMethodJavadocReference(CompilationUnitRewrite rewrite, MethodDeclaration declaration, SearchMatch match, boolean targetNode, RefactoringStatus status)(Code)
Creates the necessary change to updated a comment reference represented by a search match.
Parameters:
  rewrite - the current compilation unit rewrite
Parameters:
  declaration - the source method declaration
Parameters:
  match - the search match representing the method reference
Parameters:
  targetNode - true if a target node had to be inserted asfirst argument, false otherwise
Parameters:
  status - the refactoring status



createMethodJavadocReferences
protected void createMethodJavadocReferences(Map rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, boolean target, RefactoringStatus status, IProgressMonitor monitor)(Code)
Creates the necessary changes to update tag references to the original method.
Parameters:
  rewrites - the map of compilation units to compilation unit rewrites
Parameters:
  declaration - the source method declaration
Parameters:
  groups - the search result groups representing all references to themoved method, including references in comments
Parameters:
  target - true if a target node must be inserted as firstargument, false otherwise
Parameters:
  status - the refactoring status
Parameters:
  monitor - the progress monitor to use



createMethodReference
protected ASTNode createMethodReference(MethodDeclaration declaration, AST ast) throws JavaModelException(Code)
Creates a comment method reference to the moved method
Parameters:
  declaration - the method declaration of the original method
Parameters:
  ast - the ast to create the method reference for the created link tag to reference the method
throws:
  JavaModelException - if an error occurs



createMethodSignature
protected void createMethodSignature(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite, Map rewrites) throws JavaModelException(Code)

Parameters:
  document - the buffer containing the source of the source compilationunit
Parameters:
  declaration - the method declaration to use as source
Parameters:
  rewrite - the ast rewrite to use for the copy of the method body
Parameters:
  rewrites - the compilation unit rewrites
throws:
  JavaModelException - if the insertion point cannot be found



createMethodTypeParameters
protected void createMethodTypeParameters(ASTRewrite rewrite, MethodDeclaration declaration, RefactoringStatus status)(Code)
Creates the necessary changes to remove method type parameters if they match with enclosing type parameters.
Parameters:
  rewrite - the ast rewrite to use
Parameters:
  declaration - the method declaration to remove type parameters
Parameters:
  status - the refactoring status



createSimpleTargetAccessExpression
protected Expression createSimpleTargetAccessExpression(MethodDeclaration declaration)(Code)
Creates the expression to access the new target.
Parameters:
  declaration - the method declaration where to access the target the corresponding expression



getArgumentBindings
protected static IVariableBinding[] getArgumentBindings(MethodDeclaration declaration)(Code)
Returns the bindings of the method arguments of the specified declaration.
Parameters:
  declaration - the method declaration the array of method argument variable bindings



getArgumentTypes
protected static ITypeBinding[] getArgumentTypes(MethodDeclaration declaration)(Code)
Returns the bindings of the method argument types of the specified declaration.
Parameters:
  declaration - the method declaration the array of method argument variable bindings



getCandidateTargets
final public IVariableBinding[] getCandidateTargets()(Code)
Returns the candidate targets for the method to move. the candidate targets as variable bindings of fields andparameters



getComment
public String getComment()(Code)



getCompilationUnitRewrite
protected CompilationUnitRewrite getCompilationUnitRewrite(Map rewrites, ICompilationUnit unit)(Code)
Returns a compilation unit rewrite for the specified compilation unit.
Parameters:
  rewrites - the compilation unit rewrite map
Parameters:
  unit - the compilation unit the corresponding compilation unit rewrite



getDelegateUpdating
final public boolean getDelegateUpdating()(Code)



getDelegateUpdatingTitle
public String getDelegateUpdatingTitle(boolean plural)(Code)



getDeprecateDelegates
final public boolean getDeprecateDelegates()(Code)



getElements
final public Object[] getElements()(Code)



getIdentifier
final public String getIdentifier()(Code)



getMethod
final public IMethod getMethod()(Code)
Returns the method to be moved. the method to be moved



getMethodName
final public String getMethodName()(Code)
Returns the new method name. the name of the new method



getPossibleTargets
final public IVariableBinding[] getPossibleTargets()(Code)
Returns the possible targets for the method to move. the possible targets as variable bindings of read-only fields andparameters



getProcessorName
final public String getProcessorName()(Code)



getTargetIndex
final protected int getTargetIndex()(Code)
Returns the index of the chosen target. the target index



getTargetName
final public String getTargetName()(Code)
Returns the new target name. the name of the new target



getTargetType
protected IType getTargetType() throws JavaModelException(Code)
Returns the type of the new target. the type of the new target
throws:
  JavaModelException - if the type does not exist



initialize
protected void initialize(IMethod method)(Code)
Initializes the refactoring with the given input.
Parameters:
  method - the method to move



initialize
public RefactoringStatus initialize(RefactoringArguments arguments)(Code)



isApplicable
final public boolean isApplicable() throws CoreException(Code)



isFieldAccess
protected static boolean isFieldAccess(SimpleName name)(Code)
Is the specified name a field access?
Parameters:
  name - the name to check true if this name is a field access,false otherwise



isTargetAccess
protected boolean isTargetAccess(Name name)(Code)
Is the specified name a target access?
Parameters:
  name - the name to check true if this name is a target access,false otherwise



loadParticipants
final public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants participants) throws CoreException(Code)



needsTargetNode
final public boolean needsTargetNode()(Code)
Does the moved method need a target node? true if it needs a target node, falseotherwise



setComment
public void setComment(String comment)(Code)



setDelegateUpdating
final public void setDelegateUpdating(boolean updating)(Code)



setDeprecateDelegates
final public void setDeprecateDelegates(boolean deprecate)(Code)



setInlineDelegator
final public void setInlineDelegator(boolean inline)(Code)
Determines whether the delegator has to be inlined.
Parameters:
  inline - true to inline the delegator,false otherwise



setMethodName
final public RefactoringStatus setMethodName(String name)(Code)
Sets the new method name.
Parameters:
  name - the name to set the status of the operation



setRemoveDelegator
final public void setRemoveDelegator(boolean remove)(Code)
Determines whether the delegator has to be removed after inlining. Note that the option to inline the delegator has to be enabled if this method is called with the argument true.
Parameters:
  remove - true if it should be removed,false otherwise



setTarget
final public void setTarget(IVariableBinding target)(Code)
Sets the new target.
Parameters:
  target - the target to set



setTargetName
final public RefactoringStatus setTargetName(String name)(Code)
Sets the new target name.
Parameters:
  name - the name to set the status of the operation



setUseGetters
final public void setUseGetters(boolean use)(Code)
Determines whether getter methods should be used to resolve visibility issues.
Parameters:
  use - true if getter methods should be used,false otherwise



setUseSetters
final public void setUseSetters(boolean use)(Code)
Determines whether setter methods should be used to resolve visibility issues.
Parameters:
  use - true if setter methods should be used,false otherwise



shouldUseGetters
final public boolean shouldUseGetters()(Code)
Should getter methods be used to resolve visibility issues? true if getter methods should be used,false otherwise



shouldUseSetters
final public boolean shouldUseSetters()(Code)
Should setter methods be used to resolve visibility issues? true if setter methods should be used,false otherwise



suggestTargetName
protected String suggestTargetName()(Code)
Returns a best guess for the name of the new target. a best guess for the name



w_w__w._j___a__va2s.__c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.