Class DefaultProfileTargetingExpression
- java.lang.Object
-
- org.smooks.engine.resource.config.DefaultProfileTargetingExpression
-
- All Implemented Interfaces:
org.smooks.api.resource.config.ProfileTargetingExpression
public class DefaultProfileTargetingExpression extends Object implements org.smooks.api.resource.config.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(org.smooks.api.profile.ProfileSet profileSet)Get the specificity of this expression with respect to the supplied profile set.booleanisMatch(org.smooks.api.profile.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(org.smooks.api.profile.ProfileSet profileSet)
Does this expression match one of the profiles in the supplied profile set.- Specified by:
isMatchin interfaceorg.smooks.api.resource.config.ProfileTargetingExpression- 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(org.smooks.api.profile.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 interfaceorg.smooks.api.resource.config.ProfileTargetingExpression- 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 interfaceorg.smooks.api.resource.config.ProfileTargetingExpression- 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.
-
-