Package org.eclipse.jdt.ui.cleanup
Class CleanUpRequirements
- java.lang.Object
-
- org.eclipse.jdt.ui.cleanup.CleanUpRequirements
-
public final class CleanUpRequirements extends Object
Specifies the requirements of a clean up.- Since:
- 3.5
-
-
Constructor Summary
Constructors Constructor Description CleanUpRequirements(boolean requiresAST, boolean requiresFreshAST, boolean requiresChangedRegions, Map<String,String> compilerOptions)Create a new instanceCleanUpRequirements(CleanUpRequirementsCore requirementsCore)Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getCompilerOptions()Required compiler options.booleanrequiresAST()Tells whether the clean up requires an AST.booleanrequiresChangedRegions()Tells whether this clean up requires to be informed about changed regions.booleanrequiresFreshAST()Tells whether a fresh AST, containing all the changes from previous clean ups, will be needed.
-
-
-
Constructor Detail
-
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(CleanUpRequirementsCore requirementsCore)
Create a new instance- Parameters:
requirementsCore- a CleanUpRequirementsCore instance to use- Since:
- 3.19
-
-
Method Detail
-
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
-
getCompilerOptions
public Map<String,String> getCompilerOptions()
Required compiler options.- Returns:
- the compiler options map or
nullif none - See Also:
JavaCore
-
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
-
-