Class ConditionFactory.KeyValueRegexpCondition
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition
-
- org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueRegexpCondition
-
- All Implemented Interfaces:
Condition
,Condition.TagCondition
- Direct Known Subclasses:
ConditionFactory.RegexpKeyValueRegexpCondition
- Enclosing class:
- ConditionFactory
public static class ConditionFactory.KeyValueRegexpCondition extends ConditionFactory.KeyValueCondition
This condition requires a fixed key to match a given regexp
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition
Condition.Context, Condition.TagCondition
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.regex.Pattern
pattern
protected static java.util.Set<ConditionFactory.Op>
SUPPORTED_OPS
-
Fields inherited from class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition
considerValAsKey, k, op, v
-
-
Constructor Summary
Constructors Constructor Description KeyValueRegexpCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, boolean considerValAsKey)
Constructs a newKeyValueRegexpCondition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applies(Tagged osm)
Checks if the condition applies in the givenTagged
element.protected boolean
matches(Tagged osm)
-
Methods inherited from class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition
asTag, requiresExactKeyMatch, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition.TagCondition
applies
-
-
-
-
Field Detail
-
SUPPORTED_OPS
protected static final java.util.Set<ConditionFactory.Op> SUPPORTED_OPS
-
pattern
final java.util.regex.Pattern pattern
-
-
Constructor Detail
-
KeyValueRegexpCondition
public KeyValueRegexpCondition(java.lang.String k, java.lang.String v, ConditionFactory.Op op, boolean considerValAsKey)
Constructs a newKeyValueRegexpCondition
.- Parameters:
k
- keyv
- valueop
- operationconsiderValAsKey
- must be false- Throws:
java.util.regex.PatternSyntaxException
- if the value syntax is invalid
-
-
Method Detail
-
applies
public boolean applies(Tagged osm)
Description copied from interface:Condition
Checks if the condition applies in the givenTagged
element.- Specified by:
applies
in interfaceCondition
- Specified by:
applies
in interfaceCondition.TagCondition
- Overrides:
applies
in classConditionFactory.KeyValueCondition
- Parameters:
osm
- The tagged to check.- Returns:
true
if the condition applies.
-
-