public interface ICleanUp
The clean up is asked for its requirements through a call to getRequirements()
. The
clean up can request an AST and define how to build this AST. It can base its requirements on the
options passed through setOptions(CleanUpOptions)
.
A context containing the information requested by the requirements are passed to
createFix(CleanUpContext)
. A fix capable of fixing the problems is returned by this
function if checkPreConditions(IJavaProject, ICompilationUnit[], IProgressMonitor)
has
returned a non fatal error status.
At the end checkPostConditions(IProgressMonitor)
is called.
Modifier and Type | Method and Description |
---|---|
RefactoringStatus |
checkPostConditions(IProgressMonitor monitor)
Called when done cleaning up.
|
RefactoringStatus |
checkPreConditions(IJavaProject project,
ICompilationUnit[] compilationUnits,
IProgressMonitor monitor)
After call to checkPreConditions clients will start creating fixes for
compilationUnits in project unless the result of checkPreConditions
contains a fatal error |
ICleanUpFix |
createFix(CleanUpContext context)
Create an
ICleanUpFix which fixes all problems in context or
null if nothing to fix. |
CleanUpRequirements |
getRequirements()
The requirements of this clean up.
|
String[] |
getStepDescriptions()
Human readable description for each step this clean up will execute.
|
void |
setOptions(CleanUpOptions options)
Sets the options that will be used.
|
void setOptions(CleanUpOptions options)
options
- the options to useString[] getStepDescriptions()
Note: This method must only be called after the options have been set.
null
CleanUpRequirements getRequirements()
Note: This method must only be called after the options have been set.
createFix(CleanUpContext)
to workRefactoringStatus checkPreConditions(IJavaProject project, ICompilationUnit[] compilationUnits, IProgressMonitor monitor) throws CoreException
compilationUnits
in project
unless the result of checkPreConditions
contains a fatal errorproject
- the project to clean upcompilationUnits
- an array of compilation units to clean up, all member of project
monitor
- the monitor to show progressCoreException
- if an unexpected error occurredICleanUpFix createFix(CleanUpContext context) throws CoreException
ICleanUpFix
which fixes all problems in context
or
null
if nothing to fix.context
- a context containing all information requested by getRequirements()
null
if nothing to fixCoreException
- if an unexpected error occurredRefactoringStatus checkPostConditions(IProgressMonitor monitor) throws CoreException
monitor
- the monitor to show progressCoreException
- if an unexpected error occurred
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.