Class AbstractUpgradeStrategy
java.lang.Object
org.apache.maven.cling.invoker.mvnup.goals.AbstractUpgradeStrategy
- All Implemented Interfaces:
- UpgradeStrategy
- Direct Known Subclasses:
- CompatibilityFixStrategy,- InferenceStrategy,- ModelUpgradeStrategy,- PluginUpgradeStrategy
Abstract base class for upgrade strategies that provides common functionality
 and reduces code duplication across strategy implementations.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal UpgradeResultapply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap) Template method that handles common logging and error handling.protected abstract UpgradeResultdoApply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap) Subclasses implement the actual upgrade logic here.protected final UpgradeOptionsgetOptions(UpgradeContext context) Gets the upgrade options from the context.protected voidlogSummary(UpgradeContext context, UpgradeResult result) Logs a summary of the upgrade results.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.cling.invoker.mvnup.goals.UpgradeStrategygetDescription, isApplicable, isOptionEnabled
- 
Constructor Details- 
AbstractUpgradeStrategypublic AbstractUpgradeStrategy()
 
- 
- 
Method Details- 
applyTemplate method that handles common logging and error handling. Subclasses implement the actual upgrade logic in doApply().- Specified by:
- applyin interface- UpgradeStrategy
- Parameters:
- context- the upgrade context
- pomMap- map of all POM files in the project
- Returns:
- the result of the upgrade operation
 
- 
doApplyprotected abstract UpgradeResult doApply(UpgradeContext context, Map<Path, org.jdom2.Document> pomMap) Subclasses implement the actual upgrade logic here.- Parameters:
- context- the upgrade context
- pomMap- map of all POM files in the project
- Returns:
- the result of the upgrade operation
 
- 
getOptionsGets the upgrade options from the context.- Parameters:
- context- the upgrade context
- Returns:
- the upgrade options
 
- 
logSummaryLogs a summary of the upgrade results.- Parameters:
- context- the upgrade context
- result- the upgrade result
 
 
-