Class TagCorrector<P extends OsmPrimitive>
- java.lang.Object
-
- org.openstreetmap.josm.actions.corrector.TagCorrector<P>
-
- Type Parameters:
P
- The type of OSM primitive to correct
- Direct Known Subclasses:
ReverseWayTagCorrector
public abstract class TagCorrector<P extends OsmPrimitive> extends java.lang.Object
Abstract base class for automatic tag corrections. Subclasses call applyCorrections() with maps of the requested corrections and a dialog is presented to the user to confirm these changes.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
APPLICATION_OPTIONS
-
Constructor Summary
Constructors Constructor Description TagCorrector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<Command>
applyCorrections(DataSet dataSet, java.util.Map<OsmPrimitive,java.util.List<TagCorrection>> tagCorrectionsMap, java.util.Map<OsmPrimitive,java.util.List<RoleCorrection>> roleCorrectionMap, java.lang.String description)
Creates the commands to correct the tags.abstract java.util.Collection<Command>
execute(P oldprimitive, P primitive)
Executes the tag correction.
-
-
-
Field Detail
-
APPLICATION_OPTIONS
private static final java.lang.String[] APPLICATION_OPTIONS
-
-
Constructor Detail
-
TagCorrector
public TagCorrector()
-
-
Method Detail
-
execute
public abstract java.util.Collection<Command> execute(P oldprimitive, P primitive) throws UserCancelException
Executes the tag correction.- Parameters:
oldprimitive
- old primitiveprimitive
- new primitive- Returns:
- A list of commands
- Throws:
UserCancelException
- If the user canceled- See Also:
applyCorrections(DataSet, Map, Map, String)
-
applyCorrections
protected java.util.Collection<Command> applyCorrections(DataSet dataSet, java.util.Map<OsmPrimitive,java.util.List<TagCorrection>> tagCorrectionsMap, java.util.Map<OsmPrimitive,java.util.List<RoleCorrection>> roleCorrectionMap, java.lang.String description) throws UserCancelException
Creates the commands to correct the tags. Asks the users about it.- Parameters:
dataSet
- The data set the primitives will be in once the commands are executedtagCorrectionsMap
- The possible tag correctionsroleCorrectionMap
- The possible role correctionsdescription
- A description to add to the dialog.- Returns:
- A list of commands
- Throws:
UserCancelException
- If the user canceled
-
-