Class DefaultProfileTargetingExpression
- java.lang.Object
-
- org.smooks.engine.resource.config.DefaultProfileTargetingExpression
-
- All Implemented Interfaces:
ProfileTargetingExpression
public class DefaultProfileTargetingExpression extends Object implements ProfileTargetingExpression
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultProfileTargetingExpression.ExpressionTokenProfile targeting expression token.
-
Constructor Summary
Constructors Constructor Description DefaultProfileTargetingExpression(String expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetExpression()Get the expression used to construct this instance.protected DefaultProfileTargetingExpression.ExpressionToken[]getExpressionTokens()Get the list ofDefaultProfileTargetingExpression.ExpressionTokens parsed out of theexpressionused to construct this instance.doublegetSpecificity(ProfileSet profileSet)Get the specificity of this expression with respect to the supplied profile set.booleanisMatch(ProfileSet profileSet)Does this expression match one of the profiles in the supplied profile set.StringtoString()
-
-
-
Constructor Detail
-
DefaultProfileTargetingExpression
public DefaultProfileTargetingExpression(String expression)
-
-
Method Detail
-
isMatch
public boolean isMatch(ProfileSet profileSet)
Does this expression match one of the profiles in the supplied profile set.- Specified by:
isMatchin interfaceProfileTargetingExpression- Parameters:
profileSet- Profile set.- Returns:
- True if this expression matches one of the profiles in the supplied profile set, otherwise false.
-
getSpecificity
public double getSpecificity(ProfileSet profileSet)
Get the specificity of this expression with respect to the supplied profile set. Iterates over this expressions list ofDefaultProfileTargetingExpression.ExpressionTokens callingDefaultProfileTargetingExpression.ExpressionToken.getSpecificity(org.smooks.api.profile.ProfileSet)and adds up their specificities.- Specified by:
getSpecificityin interfaceProfileTargetingExpression- Parameters:
profileSet- Evaluation Profile Set.- Returns:
- Specificity value of the expression for the supplied profile set.
-
getExpression
public String getExpression()
Get the expression used to construct this instance.- Specified by:
getExpressionin interfaceProfileTargetingExpression- Returns:
- The expression string for this instance.
-
getExpressionTokens
protected DefaultProfileTargetingExpression.ExpressionToken[] getExpressionTokens()
Get the list ofDefaultProfileTargetingExpression.ExpressionTokens parsed out of theexpressionused to construct this instance.- Returns:
- The list of
DefaultProfileTargetingExpression.ExpressionTokens.
-
-