Package org.togglz.spring.activation
Class SpringProfileActivationStrategy
java.lang.Object
org.togglz.core.activation.AbstractTokenizedActivationStrategy
org.togglz.spring.activation.SpringProfileActivationStrategy
- All Implemented Interfaces:
ActivationStrategy
An activation strategy based on the profiles that are active within the Spring environment.
One or more profiles can be specified in a comma-separated value via the ""profiles"" parameter. This strategy works by only activating the feature if at least one of the profiles are currently active. Profile names are not case sensitive.
If a given profile is prefixed with the NOT operator (!), the feature will only be active if the profile is
not active. If the value of the ""profiles"" parameter was "p1,!p2", the feature would
only be active if "p1" is active or if "p2" is not active.
- Author:
- Alasdair Mercer
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.togglz.core.activation.AbstractTokenizedActivationStrategy
AbstractTokenizedActivationStrategy.Token, AbstractTokenizedActivationStrategy.TokenTransformer -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()getName()booleanisActive(FeatureState featureState, FeatureUser user, List<AbstractTokenizedActivationStrategy.Token> tokens) Methods inherited from class org.togglz.core.activation.AbstractTokenizedActivationStrategy
isActive, tokenize
-
Field Details
-
ID
- See Also:
-
PARAM_PROFILES
- See Also:
-
-
Constructor Details
-
SpringProfileActivationStrategy
public SpringProfileActivationStrategy()
-
-
Method Details
-
getId
-
getName
-
isActive
public boolean isActive(FeatureState featureState, FeatureUser user, List<AbstractTokenizedActivationStrategy.Token> tokens) - Specified by:
isActivein classAbstractTokenizedActivationStrategy
-
getParameters
-
getTokenParameterName
- Specified by:
getTokenParameterNamein classAbstractTokenizedActivationStrategy
-
getTokenParameterTransformer
- Overrides:
getTokenParameterTransformerin classAbstractTokenizedActivationStrategy
-