org.openstreetmap.josm.data.validation.tests
Class NameMismatch

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.Test
          extended by org.openstreetmap.josm.data.validation.tests.NameMismatch
All Implemented Interfaces:
Visitor

public class NameMismatch
extends Test

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.


Field Summary
protected static int NAME_MISSING
           
protected static int NAME_TRANSLATION_MISSING
           
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
NameMismatch()
           
 
Method Summary
 void check(OsmPrimitive p)
          Check a primitive for a name mismatch.
private  void missingTranslation(OsmPrimitive p)
          Report a missing translation.
 void visit(java.util.Collection<OsmPrimitive> selection)
          Checks a name mismatch in all primitives.
 
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, initialize, isBuilding, isCanceled, isFixable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit, visit, visit
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_MISSING

protected static final int NAME_MISSING
See Also:
Constant Field Values

NAME_TRANSLATION_MISSING

protected static final int NAME_TRANSLATION_MISSING
See Also:
Constant Field Values
Constructor Detail

NameMismatch

public NameMismatch()
Method Detail

missingTranslation

private void missingTranslation(OsmPrimitive p)
Report a missing translation.

Parameters:
p - The primitive whose translation is missing

check

public void check(OsmPrimitive p)
Check a primitive for a name mismatch.

Parameters:
p - The primitive to be tested

visit

public void visit(java.util.Collection<OsmPrimitive> selection)
Checks a name mismatch in all primitives.

Overrides:
visit in class Test
Parameters:
selection - The primitives to be tested


JOSM