Interface ICleanUp

    • Method Detail

      • setOptions

        void setOptions​(CleanUpOptions options)
        Sets the options that will be used.
        Parameters:
        options - the options to use
      • getStepDescriptions

        String[] getStepDescriptions()
        Human readable description for each step this clean up will execute.

        Note: This method must only be called after the options have been set.

        Returns:
        descriptions an array of strings or null
      • getRequirements

        CleanUpRequirements getRequirements()
        The requirements of this clean up.

        Note: This method must only be called after the options have been set.

        Returns:
        the requirements used for createFix(CleanUpContext) to work
      • checkPreConditions

        RefactoringStatus checkPreConditions​(IJavaProject project,
                                             ICompilationUnit[] compilationUnits,
                                             IProgressMonitor monitor)
                                      throws CoreException
        After call to checkPreConditions clients will start creating fixes for compilationUnits in project unless the result of checkPreConditions contains a fatal error
        Parameters:
        project - the project to clean up
        compilationUnits - an array of compilation units to clean up, all member of project
        monitor - the monitor to show progress
        Returns:
        the result of the precondition check
        Throws:
        CoreException - if an unexpected error occurred
      • createFix

        ICleanUpFix createFix​(CleanUpContext context)
                       throws CoreException
        Create an ICleanUpFix which fixes all problems in context or null if nothing to fix.
        Parameters:
        context - a context containing all information requested by getRequirements()
        Returns:
        the fix for the problems or null if nothing to fix
        Throws:
        CoreException - if an unexpected error occurred
      • checkPostConditions

        RefactoringStatus checkPostConditions​(IProgressMonitor monitor)
                                       throws CoreException
        Called when done cleaning up.
        Parameters:
        monitor - the monitor to show progress
        Returns:
        the result of the postcondition check, not null
        Throws:
        CoreException - if an unexpected error occurred