/** * Creates the necessary changes to replace the body of the method * declaration with an expression to invoke the delegate. * * @param declaration * the method declaration to replace its body * @param rewrites * the compilation unit rewrites * @param adjustments * the map of elements to visibility adjustments * @param status * the refactoring status * @param monitor * the progress monitor to display progress * @throws CoreException * if the change could not be generated */ protected void createMethodDelegation(final MethodDeclaration declaration, final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException { Assert.isNotNull(declaration); Assert.isNotNull(monitor); final DelegateInstanceMethodCreator creator= new DelegateInstanceMethodCreator(adjustments, rewrites); creator.setSourceRewrite(fSourceRewrite); creator.setCopy(false); creator.setDeclareDeprecated(fDelegateDeprecation); creator.setDeclaration(declaration); creator.setNewElementName(fMethodName); creator.prepareDelegate(); creator.createEdit(); }
/** * Creates the necessary changes to replace the body of the method * declaration with an expression to invoke the delegate. * * @param declaration * the method declaration to replace its body * @param rewrites * the compilation unit rewrites * @param adjustments * the map of elements to visibility adjustments * @param status * the refactoring status * @param monitor * the progress monitor to display progress * @throws CoreException * if the change could not be generated */ protected void createMethodDelegation(final MethodDeclaration declaration, final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException { Assert.isNotNull(declaration); Assert.isNotNull(monitor); final DelegateInstanceMethodCreator creator= new DelegateInstanceMethodCreator(adjustments, rewrites); creator.setSourceRewrite(fSourceRewrite); creator.setCopy(false); creator.setDeclareDeprecated(fDelegateDeprecation); creator.setDeclaration(declaration); creator.setNewElementName(fMethodName); creator.prepareDelegate(); creator.createEdit(); }
creator.setDeclaration(declaration); creator.setNewElementName(fMethodName); creator.prepareDelegate(); creator.createEdit();