Changeset 13028 in josm for trunk/src/org/openstreetmap/josm/actions/upload/UploadHook.java
- Timestamp:
- 2017-10-21T14:07:26+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/UploadHook.java
r12581 r13028 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions.upload; 3 4 import java.util.Map; 3 5 4 6 import org.openstreetmap.josm.data.APIDataSet; 5 7 6 8 /** 7 * A check right before the upload. The UploadHook may modify the uploaded data 8 * silently, it may display a warning message to the user or prevent the upload 9 * altogether. 9 * Change, or block, the upload. 10 * 11 * The UploadHook may modify the uploaded data silently, it may display a 12 * warning message to the user or prevent the upload altogether. 13 * 14 * The tags of the changeset can also be changed with modifyChangesetTags method. 10 15 */ 11 @FunctionalInterface12 16 public interface UploadHook { 13 17 14 18 /** 15 * Checks the upload. 16 * @param apiDataSet the data to upload 17 * @return {@code true} if upload is possible 19 * Check, and/or change, the data to be uploaded. 20 * Default implementation is to approve the upload. 21 * @param apiDataSet the data to upload, modify this to change the data. 22 * @return {@code true} if upload is possible, {@code false} to block the upload. 18 23 */ 19 boolean checkUpload(APIDataSet apiDataSet); 24 default boolean checkUpload(APIDataSet apiDataSet) { 25 return true; 26 } 27 28 /** 29 * Modify the changeset tags (in place) before upload. 30 * Default implementation is to do no changes. 31 * @param tags The current tags to change 32 * @since 13028 33 */ 34 default void modifyChangesetTags(Map<String, String> tags) { 35 } 20 36 }
Note:
See TracChangeset
for help on using the changeset viewer.