Interface UpgradeStrategy
- All Known Implementing Classes:
AbstractUpgradeStrategy
,CompatibilityFixStrategy
,InferenceStrategy
,ModelUpgradeStrategy
,PluginUpgradeStrategy
public interface UpgradeStrategy
Strategy interface for different types of upgrade operations.
Each strategy handles a specific aspect of the Maven upgrade process.
-
Method Summary
Modifier and TypeMethodDescriptionapply
(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap) Applies the upgrade strategy to all eligible POMs.Gets a description of what this strategy does.boolean
isApplicable
(UpgradeContext context) Checks if this strategy is applicable given the current options.default boolean
isOptionEnabled
(UpgradeOptions options, Optional<Boolean> specificOption, boolean defaultWhenNoOptionsSpecified) Helper method to check if a specific option is enabled, considering --all flag and defaults.
-
Method Details
-
apply
Applies the upgrade strategy to all eligible POMs.- Parameters:
context
- the upgrade contextpomMap
- map of all POM files in the project- Returns:
- the result of the upgrade operation
-
isApplicable
Checks if this strategy is applicable given the current options.- Parameters:
context
- the upgrade context- Returns:
- true if this strategy should be applied
-
isOptionEnabled
default boolean isOptionEnabled(UpgradeOptions options, Optional<Boolean> specificOption, boolean defaultWhenNoOptionsSpecified) Helper method to check if a specific option is enabled, considering --all flag and defaults.- Parameters:
options
- the upgrade optionsspecificOption
- the specific option to checkdefaultWhenNoOptionsSpecified
- whether this option should be enabled by default- Returns:
- true if the option should be enabled
-
getDescription
String getDescription()Gets a description of what this strategy does.- Returns:
- a human-readable description of the strategy
-