Package org.eclipse.jdt.ui.cleanup
Class CleanUpContext
java.lang.Object
org.eclipse.jdt.core.manipulation.CleanUpContextCore
org.eclipse.jdt.ui.cleanup.CleanUpContext
The context that contains all information required by a clean up to create a fix.
Originally from org.eclipse.jdt.ui 3.5
- Since:
- 1.21
-
Constructor Summary
ConstructorDescriptionCleanUpContext
(ICompilationUnit unit, CompilationUnit ast) Creates a new clean up context. -
Method Summary
Modifier and TypeMethodDescriptiongetAST()
An AST built from the compilation unit to fix.The compilation unit to clean up.
-
Constructor Details
-
CleanUpContext
Creates a new clean up context.- Parameters:
unit
- the compilation unitast
- the AST, can benull
ifCleanUpRequirements.requiresAST()
returnsfalse
. The AST is guaranteed to contain changes made by previous clean ups only ifCleanUpRequirements.requiresFreshAST()
returnstrue
.
-
-
Method Details
-
getCompilationUnit
Description copied from class:CleanUpContextCore
The compilation unit to clean up.- Overrides:
getCompilationUnit
in classCleanUpContextCore
- Returns:
- the compilation unit to clean up
-
getAST
Description copied from class:CleanUpContextCore
An AST built from the compilation unit to fix.Can be
null
ifCleanUpRequirementsCore.requiresAST()
returnsfalse
. The AST is guaranteed to contain changes made by previous clean ups only ifCleanUpRequirementsCore.requiresFreshAST()
returnstrue
.Clients should check the AST API level and do nothing if they are given an AST they can't handle (see
AST.apiLevel()
).- Overrides:
getAST
in classCleanUpContextCore
- Returns:
- an AST or
null
if none required
-