Class NameMismatch
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.Test.TagTest
org.openstreetmap.josm.data.validation.tests.NameMismatch
- All Implemented Interfaces:
OsmPrimitiveVisitor
Check for missing name:* translations.
This test finds multilingual objects whose 'name' attribute is not equal to any 'name:*' attribute and not a composition of some 'name:*' attributes separated by ' - '.
For example, a node with name=Europe, name:de=Europa should have name:en=Europe to avoid triggering this test. An object with name='Suomi - Finland' should have at least name:fi=Suomi and name:sv=Finland to avoid a warning (name:et=Soome would not matter). Also, complain if an object has some name:* attribute but no name.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprivate static final Patternprotected static final intFields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, stopwatch, testBeforeUpload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck a primitive for a name mismatch.booleanDetermines if the primitive is usable for tests.private voidmissingTranslation(OsmPrimitive p, String name) Report a missing translation.Methods inherited from class org.openstreetmap.josm.data.validation.Test.TagTest
includeOtherSeverityChecks, visit, visit, visitMethods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isFixable, isResidentialArea, ok, removeIrrelevantErrors, setBeforeUpload, setPartialSelection, setShowElements, startTest, testBeforeUpload, visit
-
Field Details
-
NAME_MISSING
- See Also:
-
NAME_TRANSLATION_MISSING
- See Also:
-
NAME_SPLIT_PATTERN
-
EXCLUSIONS
-
-
Constructor Details
-
NameMismatch
public NameMismatch()Constructs a newNameMismatchtest.
-
-
Method Details
-
missingTranslation
Report a missing translation.- Parameters:
p- The primitive whose translation is missingname- The name whose translation is missing
-
check
Check a primitive for a name mismatch.- Specified by:
checkin classTest.TagTest- Parameters:
p- The primitive to be tested
-
isPrimitiveUsable
Description copied from class:TestDetermines if the primitive is usable for tests.- Overrides:
isPrimitiveUsablein classTest- Parameters:
p- The primitive- Returns:
trueif the primitive can be tested,falseotherwise
-