public final class ConditionFactory extends java.lang.Object
Condition
s.Modifier and Type | Class and Description |
---|---|
static class |
ConditionFactory.ClassCondition
Class condition.
|
static class |
ConditionFactory.ExpressionCondition
A condition that is fulfilled whenever the expression is evaluated to be true.
|
static class |
ConditionFactory.IndexCondition
Index condition.
|
static class |
ConditionFactory.KeyCondition
KeyCondition represent one of the following conditions in either the link or the
primitive context:
|
static class |
ConditionFactory.KeyMatchType
This defines how
ConditionFactory.KeyCondition matches a given key. |
static class |
ConditionFactory.KeyValueCondition
Represents a key/value condition which is either applied to a primitive.
|
static class |
ConditionFactory.KeyValueRegexpCondition
This condition requires a fixed key to match a given regexp
|
static class |
ConditionFactory.Op
This is the operation that
ConditionFactory.KeyValueCondition uses to match. |
static class |
ConditionFactory.OpenEndPseudoClassCondition
Open end pseudo class condition.
|
static class |
ConditionFactory.PseudoClassCondition
Pseudo class condition.
|
static class |
ConditionFactory.PseudoClasses
Like CSS pseudo classes, MapCSS pseudo classes
are written in lower case with dashes between words.
|
static class |
ConditionFactory.RegexpKeyValueRegexpCondition
A condition that checks that a key with the matching pattern has a value with the matching pattern.
|
static class |
ConditionFactory.RoleCondition
Role condition.
|
static class |
ConditionFactory.SimpleKeyValueCondition
Most common case of a KeyValueCondition, this is the basic key=value case.
|
Modifier | Constructor and Description |
---|---|
private |
ConditionFactory() |
Modifier and Type | Method and Description |
---|---|
static ConditionFactory.ClassCondition |
createClassCondition(java.lang.String id,
boolean not,
Condition.Context context)
Create a new class condition
|
static ConditionFactory.ExpressionCondition |
createExpressionCondition(Expression e,
Condition.Context context)
Create a new condition that a expression needs to be fulfilled
|
static Condition |
createKeyCondition(java.lang.String k,
boolean not,
ConditionFactory.KeyMatchType matchType,
Condition.Context context)
Creates a condition that checks the given key.
|
static Condition |
createKeyValueCondition(java.lang.String k,
java.lang.String v,
ConditionFactory.Op op,
Condition.Context context,
boolean considerValAsKey)
Create a new condition that checks the key and the value of the object.
|
static ConditionFactory.PseudoClassCondition |
createPseudoClassCondition(java.lang.String id,
boolean not,
Condition.Context context)
Create a new pseudo class condition
|
static Condition |
createRegexpKeyRegexpValueCondition(java.lang.String k,
java.lang.String v,
ConditionFactory.Op op)
Create a condition in which the key and the value need to match a given regexp
|
private ConditionFactory()
public static Condition createKeyValueCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, Condition.Context context, boolean considerValAsKey)
k
- The key.v
- The reference valueop
- The operation to use when comparing the valuecontext
- The type of context to use.considerValAsKey
- whether to consider v
as another key and compare the values of key k
and key v
.MapCSSException
- if the arguments are incorrectpublic static Condition createRegexpKeyRegexpValueCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op)
k
- The key regexpv
- The value regexpop
- The operation to use when comparing the key and the value.public static Condition createKeyCondition(java.lang.String k, boolean not, ConditionFactory.KeyMatchType matchType, Condition.Context context)
k
- The key to test fornot
- true
to invert the matchmatchType
- The match type to check for.context
- The context this rule is found in.public static ConditionFactory.PseudoClassCondition createPseudoClassCondition(java.lang.String id, boolean not, Condition.Context context)
id
- The id of the pseudo classnot
- true
to invert the conditioncontext
- The context the class is found in.public static ConditionFactory.ClassCondition createClassCondition(java.lang.String id, boolean not, Condition.Context context)
id
- The id of the class to matchnot
- true
to invert the conditioncontext
- Ignoredpublic static ConditionFactory.ExpressionCondition createExpressionCondition(Expression e, Condition.Context context)
e
- the expression to checkcontext
- Ignored