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 class
DefaultProfileTargetingExpression.ExpressionToken
Profile targeting expression token.
-
Constructor Summary
Constructors Constructor Description DefaultProfileTargetingExpression(String expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getExpression()
Get the expression used to construct this instance.protected DefaultProfileTargetingExpression.ExpressionToken[]
getExpressionTokens()
Get the list ofDefaultProfileTargetingExpression.ExpressionToken
s parsed out of theexpression
used to construct this instance.double
getSpecificity(ProfileSet profileSet)
Get the specificity of this expression with respect to the supplied profile set.boolean
isMatch(ProfileSet profileSet)
Does this expression match one of the profiles in the supplied profile set.String
toString()
-
-
-
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:
isMatch
in 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.ExpressionToken
s callingDefaultProfileTargetingExpression.ExpressionToken.getSpecificity(org.smooks.api.profile.ProfileSet)
and adds up their specificities.- Specified by:
getSpecificity
in 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:
getExpression
in interfaceProfileTargetingExpression
- Returns:
- The expression string for this instance.
-
getExpressionTokens
protected DefaultProfileTargetingExpression.ExpressionToken[] getExpressionTokens()
Get the list ofDefaultProfileTargetingExpression.ExpressionToken
s parsed out of theexpression
used to construct this instance.- Returns:
- The list of
DefaultProfileTargetingExpression.ExpressionToken
s.
-
-