Changeset 11562 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
- Timestamp:
- 2017-02-14T23:00:03+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
r11454 r11562 14 14 import java.util.function.Predicate; 15 15 import java.util.regex.Pattern; 16 import java.util.regex.PatternSyntaxException; 16 17 17 18 import org.openstreetmap.josm.Main; … … 51 52 * @param considerValAsKey whether to consider {@code v} as another key and compare the values of key {@code k} and key {@code v}. 52 53 * @return The new condition. 54 * @throws MapCSSException if the arguments are incorrect 53 55 */ 54 56 public static Condition createKeyValueCondition(String k, String v, Op op, Context context, boolean considerValAsKey) { 55 57 switch (context) { 56 58 case PRIMITIVE: 57 if (KeyValueRegexpCondition.SUPPORTED_OPS.contains(op) && !considerValAsKey) 58 return new KeyValueRegexpCondition(k, v, op, false); 59 if (KeyValueRegexpCondition.SUPPORTED_OPS.contains(op) && !considerValAsKey) { 60 try { 61 return new KeyValueRegexpCondition(k, v, op, false); 62 } catch (PatternSyntaxException e) { 63 throw new MapCSSException(e); 64 } 65 } 59 66 if (!considerValAsKey && op.equals(Op.EQ)) 60 67 return new SimpleKeyValueCondition(k, v); … … 339 346 * @param op operation 340 347 * @param considerValAsKey must be false 348 * @throws PatternSyntaxException if the value syntax is invalid 341 349 */ 342 350 public KeyValueRegexpCondition(String k, String v, Op op, boolean considerValAsKey) {
Note:
See TracChangeset
for help on using the changeset viewer.