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.Patternpatternprotected 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 booleanapplies(Tagged osm)Checks if the condition applies in the givenTaggedelement.protected booleanmatches(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:ConditionChecks if the condition applies in the givenTaggedelement.- Specified by:
appliesin interfaceCondition- Specified by:
appliesin interfaceCondition.TagCondition- Overrides:
appliesin classConditionFactory.KeyValueCondition- Parameters:
osm- The tagged to check.- Returns:
trueif the condition applies.
-
-