Ignore:
Timestamp:
2016-05-11T22:29:43+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar, javadoc

File:
1 edited

Legend:

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

    r10006 r10194  
    2828     * Maximum number of changesets returned by the OSM API call "/changesets?"
    2929     */
    30     public static int MAX_CHANGESETS_NUMBER = 100;
    31 
    32     /**
    33      * Replies a changeset query object from the query part of a OSM API URL for querying changesets.
    34      *
    35      * @param query the query part
    36      * @return the query object
    37      * @throws ChangesetQueryUrlException if query doesn't consist of valid query parameters
    38      */
    39     public static ChangesetQuery buildFromUrlQuery(String query) throws ChangesetQueryUrlException {
    40         return new ChangesetQueryUrlParser().parse(query);
    41     }
     30    public static final int MAX_CHANGESETS_NUMBER = 100;
    4231
    4332    /** the user id this query is restricted to. null, if no restriction to a user id applies */
     
    5645    /** a collection of changeset ids to query for */
    5746    private Collection<Long> changesetIds;
     47
     48    /**
     49     * Replies a changeset query object from the query part of a OSM API URL for querying changesets.
     50     *
     51     * @param query the query part
     52     * @return the query object
     53     * @throws ChangesetQueryUrlException if query doesn't consist of valid query parameters
     54     */
     55    public static ChangesetQuery buildFromUrlQuery(String query) throws ChangesetQueryUrlException {
     56        return new ChangesetQueryUrlParser().parse(query);
     57    }
    5858
    5959    /**
     
    305305    }
    306306
     307    /**
     308     * Exception thrown for invalid changeset queries.
     309     */
    307310    public static class ChangesetQueryUrlException extends Exception {
    308311
     
    339342    }
    340343
     344    /**
     345     * Changeset query URL parser.
     346     */
    341347    public static class ChangesetQueryUrlParser {
    342348        protected int parseUid(String value) throws ChangesetQueryUrlException {
     
    486492         * </pre>
    487493         *
    488          * @param query the query string. If null, an empty query (identical to a query for all changesets) is
    489          * assumed
     494         * @param query the query string. If null, an empty query (identical to a query for all changesets) is assumed
    490495         * @return the changeset query
    491496         * @throws ChangesetQueryUrlException if the query string doesn't represent a legal query for changesets
     
    494499            if (query == null)
    495500                return new ChangesetQuery();
    496             query = query.trim();
    497             if (query.isEmpty())
     501            String apiQuery = query.trim();
     502            if (apiQuery.isEmpty())
    498503                return new ChangesetQuery();
    499             Map<String, String> queryParams = createMapFromQueryString(query);
    500             return createFromMap(queryParams);
     504            return createFromMap(createMapFromQueryString(apiQuery));
    501505        }
    502506    }
Note: See TracChangeset for help on using the changeset viewer.