public class OpeningHourTest extends Test
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.
|
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 |
---|---|
protected void |
check(OsmPrimitive p) |
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. |
protected List<Object> |
getList(Object obj) |
void |
initialize()
Initializes any global data used this tester.
|
protected Object |
parse(String value,
OpeningHourTest.CheckMode mode) |
void |
visit(Node n)
Visiting call for points.
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
addGui, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit
visit
public static final ScriptEngine ENGINE
public OpeningHourTest()
OpeningHourTest
.public void initialize() throws Exception
Test
initialize
in class Test
Exception
- When cannot initialize the testprotected Object parse(String value, OpeningHourTest.CheckMode mode) throws ScriptException, NoSuchMethodException
ScriptException
NoSuchMethodException
protected List<Object> getList(Object obj) throws ScriptException, NoSuchMethodException
ScriptException
NoSuchMethodException
public 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)
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)
protected void check(OsmPrimitive p)
public void visit(Node n)
Visitor
public void visit(Relation r)
Visitor