- Timestamp:
- 2014-08-27T02:41:05+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java
r7005 r7445 2 2 package org.openstreetmap.josm.data.validation.tests; 3 3 4 import org.openstreetmap.josm.data.osm.OsmPrimitive; 5 import org.openstreetmap.josm.data.validation.Severity; 6 import org.openstreetmap.josm.data.validation.Test; 7 import org.openstreetmap.josm.data.validation.TestError; 8 import org.openstreetmap.josm.tools.Predicates; 9 import org.openstreetmap.josm.tools.Utils; 4 import static org.openstreetmap.josm.tools.I18n.tr; 10 5 11 6 import java.util.ArrayList; … … 18 13 import java.util.regex.Pattern; 19 14 20 import static org.openstreetmap.josm.tools.I18n.tr; 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.data.validation.Severity; 17 import org.openstreetmap.josm.data.validation.Test; 18 import org.openstreetmap.josm.data.validation.TestError; 19 import org.openstreetmap.josm.tools.Predicates; 20 import org.openstreetmap.josm.tools.Utils; 21 21 22 /** 23 * Checks for <a href="http://wiki.openstreetmap.org/wiki/Conditional_restrictions">conditional restrictions</a> 24 * @since 6605 25 */ 22 26 public class ConditionalKeys extends Test.TagTest { 23 27 24 28 final OpeningHourTest openingHourTest = new OpeningHourTest(); 25 static final Set<String> RESTRICTION_TYPES = new HashSet<>(Arrays.asList("oneway", "toll", "noexit", "maxspeed", "minspeed", 29 static final Set<String> RESTRICTION_TYPES = new HashSet<>(Arrays.asList("oneway", "toll", "noexit", "maxspeed", "minspeed", "maxstay", 26 30 "maxweight", "maxaxleload", "maxheight", "maxwidth", "maxlength", "overtaking", "maxgcweight", "maxgcweightrating", "fee")); 27 31 static final Set<String> RESTRICTION_VALUES = new HashSet<>(Arrays.asList("yes", "official", "designated", "destination", … … 141 145 public List<TestError> validatePrimitive(OsmPrimitive p) { 142 146 final List<TestError> errors = new ArrayList<>(); 143 for (final String key : Utils.filter(p.keySet(), Predicates.stringMatchesPattern(Pattern.compile(".*:conditional $")))) {147 for (final String key : Utils.filter(p.keySet(), Predicates.stringMatchesPattern(Pattern.compile(".*:conditional(:.*)?$")))) { 144 148 if (!isKeyValid(key)) { 145 149 errors.add(new TestError(this, Severity.WARNING, tr("Wrong syntax in {0} key", key), 3201, p));
Note:
See TracChangeset
for help on using the changeset viewer.