Interface MapCSSTagCheckerFixCommand
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface interface MapCSSTagCheckerFixCommand
Represents a fix to a validation test. The fixingCommand
can be obtained bycreateCommand(OsmPrimitive, Selector)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static void
checkObject(Object obj)
Checks that object is either anExpression
or aString
.Command
createCommand(OsmPrimitive p, Selector matchingSelector)
Creates the fixingCommand
for the given primitive.static String
evaluateObject(Object obj, OsmPrimitive p, Selector matchingSelector)
static MapCSSTagCheckerFixCommand
fixAdd(Object obj)
Creates a fixing command which executes aChangePropertyCommand
on the specified tag.static MapCSSTagCheckerFixCommand
fixChangeKey(String oldKey, String newKey)
Creates a fixing command which executes aChangePropertyKeyCommand
on the specified keysstatic MapCSSTagCheckerFixCommand
fixRemove(Object obj)
Creates a fixing command which executes aChangePropertyCommand
to delete the specified key.
-
-
-
Method Detail
-
createCommand
Command createCommand(OsmPrimitive p, Selector matchingSelector)
Creates the fixingCommand
for the given primitive. ThematchingSelector
is used to evaluate placeholders (cf.MapCSSTagCheckerRule.insertArguments(Selector, String, OsmPrimitive)
).- Parameters:
p
- OSM primitivematchingSelector
- matching selector- Returns:
- fix command, or
null
if if cannot be created
-
checkObject
static void checkObject(Object obj)
Checks that object is either anExpression
or aString
.- Parameters:
obj
- object to check- Throws:
IllegalArgumentException
- if object is not anExpression
or aString
-
evaluateObject
static String evaluateObject(Object obj, OsmPrimitive p, Selector matchingSelector)
- Parameters:
obj
- object to evaluate (Expression
orString
)p
- OSM primitivematchingSelector
- matching selector- Returns:
- result string
-
fixAdd
static MapCSSTagCheckerFixCommand fixAdd(Object obj)
Creates a fixing command which executes aChangePropertyCommand
on the specified tag.- Parameters:
obj
- object to evaluate (Expression
orString
)- Returns:
- created fix command
-
fixRemove
static MapCSSTagCheckerFixCommand fixRemove(Object obj)
Creates a fixing command which executes aChangePropertyCommand
to delete the specified key.- Parameters:
obj
- object to evaluate (Expression
orString
)- Returns:
- created fix command
-
fixChangeKey
static MapCSSTagCheckerFixCommand fixChangeKey(String oldKey, String newKey)
Creates a fixing command which executes aChangePropertyKeyCommand
on the specified keys- Parameters:
oldKey
- old keynewKey
- new key- Returns:
- created fix command
-
-