Package org.eclipse.jdt.ui.cleanup
Class CleanUpContext
- java.lang.Object
-
- org.eclipse.jdt.core.manipulation.CleanUpContextCore
-
- org.eclipse.jdt.ui.cleanup.CleanUpContext
-
public class CleanUpContext extends CleanUpContextCore
The context that contains all information required by a clean up to create a fix.- Since:
- 3.5
-
-
Constructor Summary
Constructors Constructor Description CleanUpContext(ICompilationUnit unit, CompilationUnit ast)Creates a new clean up context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompilationUnitgetAST()An AST built from the compilation unit to fix.ICompilationUnitgetCompilationUnit()The compilation unit to clean up.
-
-
-
Constructor Detail
-
CleanUpContext
public CleanUpContext(ICompilationUnit unit, CompilationUnit ast)
Creates a new clean up context.- Parameters:
unit- the compilation unitast- the AST, can benullifCleanUpRequirements.requiresAST()returnsfalse. The AST is guaranteed to contain changes made by previous clean ups only ifCleanUpRequirements.requiresFreshAST()returnstrue.
-
-
Method Detail
-
getCompilationUnit
public ICompilationUnit getCompilationUnit()
Description copied from class:CleanUpContextCoreThe compilation unit to clean up.- Overrides:
getCompilationUnitin classCleanUpContextCore- Returns:
- the compilation unit to clean up
-
getAST
public CompilationUnit getAST()
Description copied from class:CleanUpContextCoreAn AST built from the compilation unit to fix.Can be
nullifCleanUpRequirementsCore.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:
getASTin classCleanUpContextCore- Returns:
- an AST or
nullif none required
-
-