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 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,
String key,
OpeningHourTest.CheckMode mode) |
List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(String key,
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. |
List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(String key,
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. |
List<OpeningHourTest.OpeningHoursTestError> |
checkOpeningHourSyntax(String key,
String value,
OpeningHourTest.CheckMode mode,
boolean ignoreOtherSeverity,
String locale)
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 String |
getErrorMessage(String key,
Object o)
Translates and shortens the error/warning message.
|
protected List<Object> |
getList(Object obj) |
void |
initialize()
Initializes any global data used this tester.
|
protected Object |
parse(String value,
OpeningHourTest.CheckMode mode,
String locale) |
visit, visit, visitaddGui, deletePrimitivesIfNeeded, endTest, equals, fixError, getErrors, getName, hashCode, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visitvisitpublic static final ScriptEngine ENGINE
public OpeningHourTest()
OpeningHourTest.public void initialize() throws Exception
Testinitialize in class TestException - When cannot initialize the testprotected Object parse(String value, OpeningHourTest.CheckMode mode, String locale) throws ScriptException, NoSuchMethodException
ScriptExceptionNoSuchMethodExceptionprotected List<Object> getList(Object obj) throws ScriptException, NoSuchMethodException
ScriptExceptionNoSuchMethodExceptionpublic List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(String key, 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 List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(String key, String value, OpeningHourTest.CheckMode mode, boolean ignoreOtherSeverity, String locale)
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.locale - the locale code used for localizing messagesTestError or an empty listprivate String getErrorMessage(String key, Object o)
key - OSM keyo - error/warnign messagepublic List<OpeningHourTest.OpeningHoursTestError> checkOpeningHourSyntax(String key, 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, String key, OpeningHourTest.CheckMode mode)
public void check(OsmPrimitive p)
Test.TagTestcheck in class Test.TagTestp - The primitive to test