Class ConditionProfileActivator
java.lang.Object
org.apache.maven.impl.model.profile.ConditionProfileActivator
- All Implemented Interfaces:
- ProfileActivator
@Named("condition")
@Singleton
public class ConditionProfileActivator
extends Object
implements ProfileActivator
This class is responsible for activating profiles based on conditions specified in the profile's activation section.
 It evaluates the condition expression and determines whether the profile should be active.
- 
Constructor SummaryConstructorsConstructorDescriptionConditionProfileActivator(VersionParser versionParser, Interpolator interpolator) Constructs a new ConditionProfileActivator with the necessary dependencies.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisActive(Profile profile, ProfileActivationContext context, ModelProblemCollector problems) Determines whether a profile should be active based on its condition.booleanpresentInConfig(Profile profile, ProfileActivationContext context, ModelProblemCollector problems) Checks if the condition is present in the profile's configuration.registerFunctions(ProfileActivationContext context, VersionParser versionParser) Registers the condition functions that can be used in profile activation expressions.
- 
Constructor Details- 
ConditionProfileActivatorConstructs a new ConditionProfileActivator with the necessary dependencies.- Parameters:
- versionParser- The parser for handling version comparisons
- interpolator- The interpolator for interpolating the values in the given map using the provided callback function
 
 
- 
- 
Method Details- 
isActivepublic boolean isActive(Profile profile, ProfileActivationContext context, ModelProblemCollector problems) Determines whether a profile should be active based on its condition.- Specified by:
- isActivein interface- ProfileActivator
- Parameters:
- profile- The profile to evaluate
- context- The context in which the profile is being evaluated
- problems- A collector for any problems encountered during evaluation
- Returns:
- true if the profile should be active, false otherwise
 
- 
presentInConfigpublic boolean presentInConfig(Profile profile, ProfileActivationContext context, ModelProblemCollector problems) Checks if the condition is present in the profile's configuration.- Specified by:
- presentInConfigin interface- ProfileActivator
- Parameters:
- profile- The profile to check
- context- The context in which the profile is being evaluated
- problems- A collector for any problems encountered during evaluation
- Returns:
- true if the condition is present and not blank, false otherwise
 
- 
registerFunctionspublic Map<String, ConditionParser.ExpressionFunction> registerFunctions(ProfileActivationContext context, VersionParser versionParser) Registers the condition functions that can be used in profile activation expressions.- Parameters:
- context- The profile activation context
- versionParser- The parser for handling version comparisons
- Returns:
- A map of function names to their implementations
 
 
-