Changeset 6415 in josm for trunk/src/org
- Timestamp:
- 2013-11-26T02:15:33+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r6379 r6415 150 150 * <a href="https://github.com/ypid/opening_hours.js">opening_hours.js</a> and returns a list containing 151 151 * validation errors or an empty list. Null values result in an empty list. 152 * @param key the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error message 152 153 * @param value the opening hour value to be checked. 153 154 * @param mode whether to validate {@code value} as a time range, or points in time, or both. 154 155 * @return a list of {@link TestError} or an empty list 155 156 */ 156 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String value, CheckMode mode) {157 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value, CheckMode mode) { 157 158 if (ENGINE == null || value == null || value.trim().isEmpty()) { 158 159 return Collections.emptyList(); … … 173 174 } catch (ScriptException ex) { 174 175 final String message = ex.getMessage() 175 .replaceAll("[^:]*Exception: ", "opening_hours- ")176 .replaceAll("[^:]*Exception: ", key+" - ") 176 177 .replaceAll("\\(<Unknown source.*", "") 177 178 .trim(); … … 182 183 } 183 184 184 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String value) {185 return checkOpeningHourSyntax( value, CheckMode.TIME_RANGE);185 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value) { 186 return checkOpeningHourSyntax(key, value, CheckMode.TIME_RANGE); 186 187 } 187 188 188 189 protected void check(final OsmPrimitive p, final String key, CheckMode mode) { 189 for (OpeningHoursTestError e : checkOpeningHourSyntax( p.get(key), mode)) {190 for (OpeningHoursTestError e : checkOpeningHourSyntax(key, p.get(key), mode)) { 190 191 errors.add(e.getTestError(p, key)); 191 192 }
Note:
See TracChangeset
for help on using the changeset viewer.