private static class DeprecatedTags.DeprecationCheck extends Object
test
s,
automatic change
s/keyChange
s (fixes for the deprecated tag),
or a suggestion of tagging alternatives
.Modifier and Type | Field and Description |
---|---|
protected List<Tag> |
alternatives |
protected List<Tag> |
change |
private int |
code |
protected Map<String,String> |
keyChange |
protected List<Tag> |
test |
Constructor and Description |
---|
DeprecationCheck(int code)
Creates a new
DeprecationCheck . |
Modifier and Type | Method and Description |
---|---|
(package private) DeprecatedTags.DeprecationCheck |
add(String key,
String value)
Adds an automatic fix which sets/adds the tag
key=value . |
(package private) DeprecatedTags.DeprecationCheck |
alternative(String key)
Adds a suggestion to use an alternative key
key instead of the deprecated tag. |
(package private) DeprecatedTags.DeprecationCheck |
alternative(String key,
String value)
Adds a suggestion to use an alternative tag
key=value instead of the deprecated tag. |
(package private) DeprecatedTags.DeprecationCheck |
changeKey(String oldKey,
String newKey)
Adds an automatic fix which changes the key
oldKey to newKey . |
(package private) Command |
fixPrimitive(OsmPrimitive p)
Constructs a fix in terms of a
Command for the OsmPrimitive . |
(package private) String |
getDescription()
Constructs a localized description for this deprecation check.
|
(package private) boolean |
matchesPrimitive(OsmPrimitive p)
Tests whether the
OsmPrimitive contains a deprecated tag which is represented by this DeprecationCheck . |
(package private) DeprecatedTags.DeprecationCheck |
remove(String key)
Adds an automatic fix which removes the key
key . |
(package private) DeprecatedTags.DeprecationCheck |
test(String key)
Adds a test criterion which matches primitives with key
key . |
(package private) DeprecatedTags.DeprecationCheck |
test(String key,
String value)
Adds a test criterion which matches primitives with tag
key=value . |
(package private) DeprecatedTags.DeprecationCheck |
testAndRemove(String key,
String value)
Adds a test criterion which matches primitives with tag
key=value ,
and an automatic fix which removes the key key . |
private int code
protected final List<Tag> alternatives
public DeprecationCheck(int code)
DeprecationCheck
.code
- TestError.code
DeprecatedTags.DeprecationCheck test(String key, String value)
key=value
.this
DeprecatedTags.DeprecationCheck test(String key)
key
.this
DeprecatedTags.DeprecationCheck add(String key, String value)
key=value
.this
alternative(String, String)
,
alternative(String)
DeprecatedTags.DeprecationCheck remove(String key)
key
.this
DeprecatedTags.DeprecationCheck changeKey(String oldKey, String newKey)
oldKey
to newKey
.this
DeprecatedTags.DeprecationCheck testAndRemove(String key, String value)
key=value
,
and an automatic fix which removes the key key
.
Equivalent to test(String, String)
plus remove(String)
.this
DeprecatedTags.DeprecationCheck alternative(String key, String value)
key=value
instead of the deprecated tag.
This is used for cases where no automatic fix is sensible.this
DeprecatedTags.DeprecationCheck alternative(String key)
key
instead of the deprecated tag.
This is used for cases where no automatic fix is sensible.this
boolean matchesPrimitive(OsmPrimitive p)
OsmPrimitive
contains a deprecated tag which is represented by this DeprecationCheck
.p
- the primitive to testCommand fixPrimitive(OsmPrimitive p)
Command
for the OsmPrimitive
.p
- the primitive to construct the fix forString getDescription()