public class OpeningHourTest extends Test.TagTest
opening_hours, collection_times, service_times according to
opening_hours.js.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
OpeningHourTest.CheckMode |
class |
OpeningHourTest.OpeningHoursTestError
An error concerning invalid syntax for an "opening_hours"-like tag.
|
Test.TagTest| Modifier and Type | Field and Description |
|---|---|
static javax.script.ScriptEngine |
ENGINE
Javascript engine
|
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload| Constructor and Description |
|---|
OpeningHourTest()
Constructs a new
OpeningHourTest. |
| Modifier and Type | Method and Description |
|---|---|
void |
check(OsmPrimitive p)
Checks the tags of the given primitive.
|
protected void |
check(OsmPrimitive p,
java.lang.String key,
OpeningHourTest.CheckMode mode) |
java.util.List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(java.lang.String key,
java.lang.String value)
Checks for a correct usage of the opening hour syntax of the
value given, in time range mode, according to
opening_hours.js and returns a list containing
validation errors or an empty list. |
java.util.List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(java.lang.String key,
java.lang.String value,
OpeningHourTest.CheckMode mode)
Checks for a correct usage of the opening hour syntax of the
value given according to
opening_hours.js and returns a list containing
validation errors or an empty list. |
java.util.List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(java.lang.String key,
java.lang.String value,
OpeningHourTest.CheckMode mode,
boolean ignoreOtherSeverity)
Checks for a correct usage of the opening hour syntax of the
value given according to
opening_hours.js and returns a list containing
validation errors or an empty list. |
private java.lang.String |
getErrorMessage(java.lang.String key,
java.lang.Object o)
Translates and shortens the error/warning message.
|
protected java.util.List<java.lang.Object> |
getList(java.lang.Object obj) |
void |
initialize()
Initializes any global data used this tester.
|
protected java.lang.Object |
parse(java.lang.String value,
OpeningHourTest.CheckMode mode) |
visit, visit, visitaddGui, deletePrimitivesIfNeeded, endTest, equals, fixError, getErrors, getName, hashCode, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visitvisitpublic static final javax.script.ScriptEngine ENGINE
public OpeningHourTest()
OpeningHourTest.public void initialize() throws java.lang.Exception
Testinitialize in class Testjava.lang.Exception - When cannot initialize the testprotected java.lang.Object parse(java.lang.String value, OpeningHourTest.CheckMode mode) throws javax.script.ScriptException, java.lang.NoSuchMethodException
javax.script.ScriptExceptionjava.lang.NoSuchMethodExceptionprotected java.util.List<java.lang.Object> getList(java.lang.Object obj) throws javax.script.ScriptException, java.lang.NoSuchMethodException
javax.script.ScriptExceptionjava.lang.NoSuchMethodExceptionpublic java.util.List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(java.lang.String key, java.lang.String value, OpeningHourTest.CheckMode mode)
value given according to
opening_hours.js and returns a list containing
validation errors or an empty list. Null values result in an empty list.key - the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error messagevalue - the opening hour value to be checked.mode - whether to validate value as a time range, or points in time, or both.TestError or an empty listpublic java.util.List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(java.lang.String key, java.lang.String value, OpeningHourTest.CheckMode mode, boolean ignoreOtherSeverity)
value given according to
opening_hours.js and returns a list containing
validation errors or an empty list. Null values result in an empty list.key - the OSM key (should be "opening_hours", "collection_times" or "service_times").value - the opening hour value to be checked.mode - whether to validate value as a time range, or points in time, or both.ignoreOtherSeverity - whether to ignore errors with Severity.OTHER.TestError or an empty listprivate java.lang.String getErrorMessage(java.lang.String key, java.lang.Object o)
public java.util.List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(java.lang.String key, java.lang.String value)
value given, in time range mode, according to
opening_hours.js and returns a list containing
validation errors or an empty list. Null values result in an empty list.key - the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error messagevalue - the opening hour value to be checked.TestError or an empty listprotected void check(OsmPrimitive p, java.lang.String key, OpeningHourTest.CheckMode mode)
public void check(OsmPrimitive p)
Test.TagTestcheck in class Test.TagTestp - The primitive to test