|
Last change
on this file was 18801, checked in by taylor.smock, 3 years ago |
|
Fix #22832: Code cleanup and some simplification, documentation fixes (patch by gaben)
There should not be any functional changes in this patch; it is intended to do
the following:
- Simplify and cleanup code (example:
Arrays.asList(item) -> Collections.singletonList(item))
- Fix typos in documentation (which also corrects the documentation to match what actually happens, in some cases)
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.actions.upload;
|
|---|
| 3 |
|
|---|
| 4 | import java.util.Map;
|
|---|
| 5 |
|
|---|
| 6 | import org.openstreetmap.josm.data.APIDataSet;
|
|---|
| 7 |
|
|---|
| 8 | /**
|
|---|
| 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.
|
|---|
| 15 | */
|
|---|
| 16 | public interface UploadHook {
|
|---|
| 17 |
|
|---|
| 18 | /**
|
|---|
| 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.
|
|---|
| 23 | */
|
|---|
| 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 | }
|
|---|
| 36 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.