Package org.eclipse.jdt.ui.cleanup
Class CleanUpRequirements
java.lang.Object
org.eclipse.jdt.ui.cleanup.CleanUpRequirements
Specifies the requirements of a clean up.
Originally from org.eclipse.jdt.ui 3.5
- Since:
- 1.21
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final booleanprotected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionCleanUpRequirements(boolean requiresAST, boolean requiresFreshAST, boolean requiresChangedRegions, boolean requiresSeparateOptions, Map<String, String> compilerOptions) Create a new instanceCleanUpRequirements(boolean requiresAST, boolean requiresFreshAST, boolean requiresChangedRegions, Map<String, String> compilerOptions) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionRequired compiler options.booleanTells whether the clean up requires an AST.booleanTells whether this clean up requires to be informed about changed regions.booleanTells whether a fresh AST, containing all the changes from previous clean ups, will be needed.booleanTells whether separate compiler options are required as the options should not be shared with other cleanups.
-
Field Details
-
fRequiresAST
protected final boolean fRequiresAST -
fCompilerOptions
-
fRequiresFreshAST
protected final boolean fRequiresFreshAST -
fRequiresChangedRegions
protected final boolean fRequiresChangedRegions -
fRequiresSeparateOptions
protected final boolean fRequiresSeparateOptions
-
-
Constructor Details
-
CleanUpRequirements
public CleanUpRequirements(boolean requiresAST, boolean requiresFreshAST, boolean requiresChangedRegions, Map<String, String> compilerOptions) Create a new instance- Parameters:
requiresAST-trueif an AST is requiredrequiresFreshAST-trueif a fresh AST is requiredrequiresChangedRegions-trueif changed regions are requiredcompilerOptions- map of compiler options ornullif no requirements
-
CleanUpRequirements
public CleanUpRequirements(boolean requiresAST, boolean requiresFreshAST, boolean requiresChangedRegions, boolean requiresSeparateOptions, Map<String, String> compilerOptions) Create a new instance- Parameters:
requiresAST-trueif an AST is requiredrequiresFreshAST-trueif a fresh AST is requiredrequiresChangedRegions-trueif changed regions are requiredrequiresSeparateOptions-trueif clean up has options that should not be sharedcompilerOptions- map of compiler options ornullif no requirements- Since:
- 1.23
-
-
Method Details
-
requiresAST
public boolean requiresAST()Tells whether the clean up requires an AST.Note: This should return
falsewhenever possible because creating an AST is expensive.- Returns:
trueif the CleanUpContext context must provide an AST
-
requiresFreshAST
public boolean requiresFreshAST()Tells whether a fresh AST, containing all the changes from previous clean ups, will be needed.- Returns:
trueif the caller needs an up to date AST
-
requiresSeparateOptions
public boolean requiresSeparateOptions()Tells whether separate compiler options are required as the options should not be shared with other cleanups.- Returns:
trueif the cleanup has its own options.- Since:
- 1.23
-
getCompilerOptions
Required compiler options.- Returns:
- the compiler options map or
nullif none - See Also:
-
requiresChangedRegions
public boolean requiresChangedRegions()Tells whether this clean up requires to be informed about changed regions. The changed regions are the regions which have been changed between the last save state of the compilation unit and its current state.Has only an effect if the clean up is used as save action.
Note:: This should return
falsewhenever possible because calculating the changed regions is expensive.- Returns:
trueif the CleanUpContext context must provide changed regions
-