Ignore:
Timestamp:
2020-04-11T18:00:31+02:00 (6 years ago)
Author:
simon04
Message:

fix #18164 - Migrate OverpassTurboQueryWizard to Java

The new OverpassTurboQueryWizard first invokes SearchCompiler, and then turns the AST into an Overpass QL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

    r16260 r16262  
    505505     * Matches if the value of the corresponding key is ''yes'', ''true'', ''1'' or ''on''.
    506506     */
    507     private static class BooleanMatch extends TaggedMatch {
     507    public static class BooleanMatch extends TaggedMatch {
    508508        private final String key;
    509509        private final boolean defaultValue;
     
    512512            this.key = key;
    513513            this.defaultValue = defaultValue;
     514        }
     515
     516        public String getKey() {
     517            return key;
    514518        }
    515519
     
    710714     * Matches objects with the given key-value pair.
    711715     */
    712     private static class KeyValue extends TaggedMatch {
     716    public static class KeyValue extends TaggedMatch {
    713717        private final String key;
    714718        private final Pattern keyPattern;
     
    775779        }
    776780
     781        public String getKey() {
     782            return key;
     783        }
     784
     785        public String getValue() {
     786            return value;
     787        }
     788
    777789        @Override
    778790        public String toString() {
     
    891903    public static class ExactKeyValue extends TaggedMatch {
    892904
    893         enum Mode {
     905        public enum Mode {
    894906            ANY, ANY_KEY, ANY_VALUE, EXACT, NONE, MISSING_KEY,
    895907            ANY_KEY_REGEXP, ANY_VALUE_REGEXP, EXACT_REGEXP, MISSING_KEY_REGEXP;
     
    10031015        }
    10041016
     1017        public String getKey() {
     1018            return key;
     1019        }
     1020
     1021        public String getValue() {
     1022            return value;
     1023        }
     1024
     1025        public Mode getMode() {
     1026            return mode;
     1027        }
     1028
    10051029        @Override
    10061030        public String toString() {
     
    11481172    }
    11491173
    1150     private static class ExactType extends Match {
     1174    public static class ExactType extends Match {
    11511175        private final OsmPrimitiveType type;
    11521176
     
    11571181        }
    11581182
     1183        public OsmPrimitiveType getType() {
     1184            return type;
     1185        }
     1186
    11591187        @Override
    11601188        public boolean match(OsmPrimitive osm) {
     
    11861214     * Matches objects last changed by the given username.
    11871215     */
    1188     private static class UserMatch extends Match {
     1216    public static class UserMatch extends Match {
    11891217        private String user;
    11901218
     
    11951223                this.user = user;
    11961224            }
     1225        }
     1226
     1227        public String getUser() {
     1228            return user;
    11971229        }
    11981230
Note: See TracChangeset for help on using the changeset viewer.