Class ConditionFactory.KeyRegexpCondition
java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyRegexpCondition
- All Implemented Interfaces:
Condition,Condition.TagCondition
- Enclosing class:
- ConditionFactory
public static class ConditionFactory.KeyRegexpCondition
extends Object
implements Condition.TagCondition
KeyPatternCondition represents a conditions matching keys based on a pattern.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition
Condition.Context, Condition.TagCondition -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanIf we should negate the result of the match.final PatternA predicate used to match a the regexp against the key. -
Constructor Summary
ConstructorsConstructorDescriptionKeyRegexpCondition(Pattern pattern, boolean negateResult) Creates a new KeyPatternCondition -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Condition.TagCondition
applies
-
Field Details
-
pattern
A predicate used to match a the regexp against the key. Only used if the match type is regexp. -
negateResult
If we should negate the result of the match.
-
-
Constructor Details
-
KeyRegexpCondition
Creates a new KeyPatternCondition- Parameters:
pattern- The regular expression for matching keys.negateResult- If we should negate the result.
-
-
Method Details
-
applies
Description copied from interface:ConditionChecks if the condition applies in the givenTaggedelement.- Specified by:
appliesin interfaceCondition- Specified by:
appliesin interfaceCondition.TagCondition- Parameters:
osm- The tagged to check.- Returns:
trueif the condition applies.
-
asTag
Get the matched key and the corresponding value.WARNING: This ignores
negateResult.WARNING: For regexp, the regular expression is returned instead of a key if the match failed.
- Specified by:
asTagin interfaceCondition.TagCondition- Parameters:
p- The primitive to get the value from.- Returns:
- The tag.
-
toString
-