public class ConditionalKeys extends Test.TagTest
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConditionalKeys.ConditionalParsingException |
static class |
ConditionalKeys.ConditionalValue
A conditional value is a value for the access restriction tag that depends on conditions (time, ...)
|
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
CONDITIONAL_PATTERN |
private OpeningHourTest |
openingHourTest |
private static java.util.Set<java.lang.String> |
RESTRICTION_TYPES |
private static java.util.Set<java.lang.String> |
RESTRICTION_VALUES |
private static java.util.Set<java.lang.String> |
TRANSPORT_MODES |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
ConditionalKeys()
Constructs a new
ConditionalKeys . |
Modifier and Type | Method and Description |
---|---|
void |
check(OsmPrimitive p)
Checks the tags of the given primitive.
|
void |
initialize()
Initializes any global data used this tester.
|
static boolean |
isDirection(java.lang.String part)
Check if a key part is a valid direction
|
boolean |
isKeyValid(java.lang.String key)
Checks if a given key is a valid access key
|
private static boolean |
isKeyValid1Part(java.lang.String... parts) |
private static boolean |
isKeyValid2Parts(java.lang.String... parts) |
private static boolean |
isKeyValid3Parts(java.lang.String... parts) |
static boolean |
isRestrictionType(java.lang.String part)
Check if the key is a key for an access restriction
|
static boolean |
isRestrictionValue(java.lang.String part)
Check if the value is a valid restriction value
|
static boolean |
isTransportationMode(java.lang.String part)
Checks if the key denotes a
transport access mode restriction
|
boolean |
isValueValid(java.lang.String key,
java.lang.String value)
Check if a value is valid
|
java.util.List<TestError> |
validatePrimitive(OsmPrimitive p)
Validate a primitive
|
java.lang.String |
validateValue(java.lang.String key,
java.lang.String value)
Validate a key/value pair
|
visit, visit, visit
addGui, clear, compareTo, deletePrimitivesIfNeeded, endTest, equals, fixError, getErrors, getName, hashCode, isBuilding, isCanceled, isFixable, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, startTest, testBeforeUpload, visit
private final OpeningHourTest openingHourTest
private static final java.util.Set<java.lang.String> RESTRICTION_TYPES
private static final java.util.Set<java.lang.String> RESTRICTION_VALUES
private static final java.util.Set<java.lang.String> TRANSPORT_MODES
private static final java.util.regex.Pattern CONDITIONAL_PATTERN
public ConditionalKeys()
ConditionalKeys
.public void initialize() throws java.lang.Exception
Test
initialize
in class Test
java.lang.Exception
- When cannot initialize the testpublic static boolean isRestrictionType(java.lang.String part)
part
- The key (or the restriction part of it, e.g. for lanes)true
if it is a restrictionpublic static boolean isRestrictionValue(java.lang.String part)
part
- The valuetrue
for allowed restriction valuespublic static boolean isTransportationMode(java.lang.String part)
part
- The key (or the restriction part of it, e.g. for lanes)true
if it is a restrictionpublic static boolean isDirection(java.lang.String part)
part
- The part of the keytrue
if it is a directionpublic boolean isKeyValid(java.lang.String key)
key
- The conditional keytrue
if the key is validprivate static boolean isKeyValid3Parts(java.lang.String... parts)
private static boolean isKeyValid2Parts(java.lang.String... parts)
private static boolean isKeyValid1Part(java.lang.String... parts)
public boolean isValueValid(java.lang.String key, java.lang.String value)
key
- The key the value is forvalue
- The valuetrue
if it is validpublic java.lang.String validateValue(java.lang.String key, java.lang.String value)
key
- The keyvalue
- The valuenull
to indicate validpublic java.util.List<TestError> validatePrimitive(OsmPrimitive p)
p
- The primitivepublic void check(OsmPrimitive p)
Test.TagTest
check
in class Test.TagTest
p
- The primitive to test