Changeset 11919 in josm for trunk


Ignore:
Timestamp:
2017-04-15T16:42:23+02:00 (8 years ago)
Author:
Don-vip
Message:

see #14653 - refactor AbstractReader

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/AbstractReader.java

    r10308 r11919  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.io.InputStream;
    67import java.util.ArrayList;
    78import java.util.Collection;
     
    2324import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
    2425import org.openstreetmap.josm.data.osm.Way;
     26import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2527
    2628/**
     
    202204        }
    203205    }
     206
     207    protected abstract DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException;
    204208}
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r11709 r11919  
    585585    }
    586586
     587    @Override
    587588    protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
    588589        if (progressMonitor == null) {
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r11918 r11919  
    9999    static final Pattern OUTPUT_FORMAT_STATEMENT = Pattern.compile(".*\\[out:([a-z]{3,})\\].*", Pattern.DOTALL);
    100100
    101     static final Map<OverpassOutpoutFormat, Class<? extends OsmReader>> outputFormatReaders = new ConcurrentHashMap<>();
     101    static final Map<OverpassOutpoutFormat, Class<? extends AbstractReader>> outputFormatReaders = new ConcurrentHashMap<>();
    102102
    103103    final String overpassServer;
     
    123123     * @return the previous value associated with {@code format}, or {@code null} if there was no mapping
    124124     */
    125     public static final Class<? extends OsmReader> registerOverpassOutpoutFormatReader(
    126             OverpassOutpoutFormat format, Class<? extends OsmReader> readerClass) {
     125    public static final Class<? extends AbstractReader> registerOverpassOutpoutFormatReader(
     126            OverpassOutpoutFormat format, Class<? extends AbstractReader> readerClass) {
    127127        return outputFormatReaders.put(Objects.requireNonNull(format), Objects.requireNonNull(readerClass));
    128128    }
     
    230230    @Override
    231231    protected DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
    232         OsmReader reader = null;
     232        AbstractReader reader = null;
    233233        Matcher m = OUTPUT_FORMAT_STATEMENT.matcher(overpassQuery);
    234234        if (m.matches()) {
    235             Class<? extends OsmReader> readerClass = outputFormatReaders.get(OverpassOutpoutFormat.from(m.group(1)));
     235            Class<? extends AbstractReader> readerClass = outputFormatReaders.get(OverpassOutpoutFormat.from(m.group(1)));
    236236            if (readerClass != null) {
    237237                try {
Note: See TracChangeset for help on using the changeset viewer.