|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.osm.visitor.AbstractVisitor
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.TagChecker
public class TagChecker
Check for misspelled or wrong properties
Nested Class Summary | |
---|---|
protected static class |
TagChecker.CheckerData
|
protected static class |
TagChecker.IgnoreKeyPair
|
Field Summary | |
---|---|
protected javax.swing.JButton |
addSrcButton
|
protected boolean |
checkComplex
|
protected static java.util.List<TagChecker.CheckerData> |
checkerData
The TagChecker data |
protected boolean |
checkFixmes
|
protected boolean |
checkKeys
|
protected boolean |
checkValues
|
static java.lang.String |
DATA_FILE
The default data files |
protected javax.swing.JButton |
deleteSrcButton
|
protected javax.swing.JButton |
editSrcButton
|
protected static int |
EMPTY_VALUES
|
protected static Entities |
entities
|
protected static int |
FIXME
|
static java.lang.String |
IGNORE_FILE
|
protected static java.util.List<java.lang.String> |
ignoreDataEndsWith
|
protected static java.util.List<java.lang.String> |
ignoreDataEquals
|
protected static java.util.List<TagChecker.IgnoreKeyPair> |
ignoreDataKeyPair
|
protected static java.util.List<java.lang.String> |
ignoreDataStartsWith
|
protected static int |
INVALID_HTML
|
protected static int |
INVALID_KEY
|
protected static int |
INVALID_KEY_SPACE
|
protected static int |
INVALID_SPACE
|
protected static int |
INVALID_VALUE
|
protected static int |
LONG_KEY
|
protected static int |
LONG_VALUE
|
protected static int |
LOW_CHAR_KEY
|
protected static int |
LOW_CHAR_VALUE
|
static java.lang.String |
PREF_CHECK_COMPLEX
|
static java.lang.String |
PREF_CHECK_COMPLEX_BEFORE_UPLOAD
|
static java.lang.String |
PREF_CHECK_FIXMES
|
static java.lang.String |
PREF_CHECK_FIXMES_BEFORE_UPLOAD
|
static java.lang.String |
PREF_CHECK_KEYS
|
static java.lang.String |
PREF_CHECK_KEYS_BEFORE_UPLOAD
|
static java.lang.String |
PREF_CHECK_VALUES
|
static java.lang.String |
PREF_CHECK_VALUES_BEFORE_UPLOAD
|
static java.lang.String |
PREF_SOURCES
|
static java.lang.String |
PREF_USE_DATA_FILE
|
static java.lang.String |
PREF_USE_IGNORE_FILE
|
static java.lang.String |
PREF_USE_SPELL_FILE
|
protected javax.swing.JCheckBox |
prefCheckComplex
|
protected javax.swing.JCheckBox |
prefCheckComplexBeforeUpload
|
protected javax.swing.JCheckBox |
prefCheckFixmes
|
protected javax.swing.JCheckBox |
prefCheckFixmesBeforeUpload
|
protected javax.swing.JCheckBox |
prefCheckKeys
|
protected javax.swing.JCheckBox |
prefCheckKeysBeforeUpload
|
protected javax.swing.JCheckBox |
prefCheckPaint
|
protected javax.swing.JCheckBox |
prefCheckPaintBeforeUpload
|
protected javax.swing.JCheckBox |
prefCheckValues
|
protected javax.swing.JCheckBox |
prefCheckValuesBeforeUpload
|
protected static java.lang.String |
PREFIX
The preferences prefix |
protected javax.swing.JCheckBox |
prefUseDataFile
|
protected javax.swing.JCheckBox |
prefUseIgnoreFile
|
protected javax.swing.JCheckBox |
prefUseSpellFile
|
protected static MultiMap<java.lang.String,java.lang.String> |
presetsValueData
The spell check preset values |
protected javax.swing.JList |
sourcesList
List of sources for spellcheck data |
static java.lang.String |
SPELL_FILE
|
protected static java.util.Map<java.lang.String,java.lang.String> |
spellCheckKeyData
The spell check key substitutions: the key should be substituted by the value |
Fields inherited from class org.openstreetmap.josm.data.validation.Test |
---|
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload |
Constructor Summary | |
---|---|
TagChecker()
Constructor |
Method Summary | |
---|---|
void |
addGui(javax.swing.JPanel testPanel)
Allow the tester to manage its own preferences |
private void |
checkPrimitive(OsmPrimitive p)
Checks the primitive properties |
private boolean |
containsLow(java.lang.String s)
Checks given string (key or value) if it contains characters with code below 0x20 (either newline or some other special characters) |
Command |
fixError(TestError testError)
Fixes the error with the appropriate command |
void |
handlePrefEnable()
|
void |
initialize()
Initializes any global data used this tester. |
private static void |
initializeData()
Reads the spellcheck file into a HashMap. |
static void |
initializePresets()
Reads the presets data. |
boolean |
isFixable(TestError testError)
Returns true if the given error can be fixed automatically |
boolean |
ok()
Called when the used submits the preferences |
void |
startTest(ProgressMonitor monitor)
Start the test using a given progress monitor |
void |
visit(java.util.Collection<OsmPrimitive> selection)
Visits all primitives to be tested. |
void |
visit(Node n)
Visiting call for points. |
void |
visit(Relation n)
Visiting call for relations. |
void |
visit(Way w)
Visiting call for lines. |
Methods inherited from class org.openstreetmap.josm.data.validation.Test |
---|
deletePrimitivesIfNeeded, endTest, getErrors, getName, isBuilding, isCanceled, setBeforeUpload, setPartialSelection, testBeforeUpload |
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 |
---|
public static final java.lang.String DATA_FILE
public static final java.lang.String IGNORE_FILE
public static final java.lang.String SPELL_FILE
protected static java.util.Map<java.lang.String,java.lang.String> spellCheckKeyData
protected static MultiMap<java.lang.String,java.lang.String> presetsValueData
protected static final java.util.List<TagChecker.CheckerData> checkerData
protected static final java.util.List<java.lang.String> ignoreDataStartsWith
protected static final java.util.List<java.lang.String> ignoreDataEquals
protected static final java.util.List<java.lang.String> ignoreDataEndsWith
protected static final java.util.List<TagChecker.IgnoreKeyPair> ignoreDataKeyPair
protected static final java.lang.String PREFIX
public static final java.lang.String PREF_CHECK_VALUES
public static final java.lang.String PREF_CHECK_KEYS
public static final java.lang.String PREF_CHECK_COMPLEX
public static final java.lang.String PREF_CHECK_FIXMES
public static final java.lang.String PREF_SOURCES
public static final java.lang.String PREF_USE_DATA_FILE
public static final java.lang.String PREF_USE_IGNORE_FILE
public static final java.lang.String PREF_USE_SPELL_FILE
public static final java.lang.String PREF_CHECK_KEYS_BEFORE_UPLOAD
public static final java.lang.String PREF_CHECK_VALUES_BEFORE_UPLOAD
public static final java.lang.String PREF_CHECK_COMPLEX_BEFORE_UPLOAD
public static final java.lang.String PREF_CHECK_FIXMES_BEFORE_UPLOAD
protected boolean checkKeys
protected boolean checkValues
protected boolean checkComplex
protected boolean checkFixmes
protected javax.swing.JCheckBox prefCheckKeys
protected javax.swing.JCheckBox prefCheckValues
protected javax.swing.JCheckBox prefCheckComplex
protected javax.swing.JCheckBox prefCheckFixmes
protected javax.swing.JCheckBox prefCheckPaint
protected javax.swing.JCheckBox prefCheckKeysBeforeUpload
protected javax.swing.JCheckBox prefCheckValuesBeforeUpload
protected javax.swing.JCheckBox prefCheckComplexBeforeUpload
protected javax.swing.JCheckBox prefCheckFixmesBeforeUpload
protected javax.swing.JCheckBox prefCheckPaintBeforeUpload
protected javax.swing.JCheckBox prefUseDataFile
protected javax.swing.JCheckBox prefUseIgnoreFile
protected javax.swing.JCheckBox prefUseSpellFile
protected javax.swing.JButton addSrcButton
protected javax.swing.JButton editSrcButton
protected javax.swing.JButton deleteSrcButton
protected static final int EMPTY_VALUES
protected static final int INVALID_KEY
protected static final int INVALID_VALUE
protected static final int FIXME
protected static final int INVALID_SPACE
protected static final int INVALID_KEY_SPACE
protected static final int INVALID_HTML
protected static final int LONG_VALUE
protected static final int LONG_KEY
protected static final int LOW_CHAR_VALUE
protected static final int LOW_CHAR_KEY
protected javax.swing.JList sourcesList
protected static final Entities entities
Constructor Detail |
---|
public TagChecker()
Method Detail |
---|
public void initialize() throws java.io.IOException
Test
initialize
in class Test
java.io.IOException
private static void initializeData() throws java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static void initializePresets()
public void visit(Node n)
Visitor
visit
in interface Visitor
visit
in class Test
n
- The node to inspect.public void visit(Relation n)
Visitor
visit
in interface Visitor
visit
in class Test
n
- The relation to inspect.public void visit(Way w)
Visitor
visit
in interface Visitor
visit
in class Test
w
- The way to inspect.private boolean containsLow(java.lang.String s)
s
- string to checkprivate void checkPrimitive(OsmPrimitive p)
p
- The primitive to checkpublic void startTest(ProgressMonitor monitor)
Test
startTest
in class Test
monitor
- the progress monitorpublic void visit(java.util.Collection<OsmPrimitive> selection)
Test
visit
in class Test
selection
- The primitives to be testedpublic void addGui(javax.swing.JPanel testPanel)
Test
addGui
in class Test
testPanel
- The panel to add any preferences componentpublic void handlePrefEnable()
public boolean ok()
Test
ok
in class Test
public Command fixError(TestError testError)
Test
fixError
in class Test
public boolean isFixable(TestError testError)
Test
isFixable
in class Test
testError
- The error to check if can be fixed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |