public class TagChecker extends Test
Modifier and Type | Class and Description |
---|---|
protected static class |
TagChecker.CheckerData |
protected static class |
TagChecker.IgnoreKeyPair |
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
TagChecker()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addGui(JPanel testPanel)
Allow the tester to manage its own preferences
|
private static void |
addPresetValue(TaggingPreset p,
TaggingPresetItems.KeyedItem ky) |
private void |
checkPrimitive(OsmPrimitive p)
Checks the primitive tags
|
private boolean |
containsLow(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(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.
|
deletePrimitivesIfNeeded, endTest, getErrors, getName, isBuilding, isCanceled, isPrimitiveUsable, setBeforeUpload, setPartialSelection, testBeforeUpload
visit
public static final String DATA_FILE
public static final String IGNORE_FILE
public static final String SPELL_FILE
protected static Map<String,String> spellCheckKeyData
protected static MultiMap<String,String> presetsValueData
protected static final List<TagChecker.CheckerData> checkerData
protected static final List<String> ignoreDataStartsWith
protected static final List<String> ignoreDataEquals
protected static final List<String> ignoreDataEndsWith
protected static final List<TagChecker.IgnoreKeyPair> ignoreDataKeyPair
public static final String PREF_CHECK_VALUES
public static final String PREF_CHECK_KEYS
public static final String PREF_CHECK_COMPLEX
public static final String PREF_CHECK_FIXMES
public static final String PREF_SOURCES
public static final String PREF_USE_DATA_FILE
public static final String PREF_USE_IGNORE_FILE
public static final String PREF_USE_SPELL_FILE
public static final String PREF_CHECK_KEYS_BEFORE_UPLOAD
public static final String PREF_CHECK_VALUES_BEFORE_UPLOAD
public static final String PREF_CHECK_COMPLEX_BEFORE_UPLOAD
public static final String PREF_CHECK_FIXMES_BEFORE_UPLOAD
protected boolean checkKeys
protected boolean checkValues
protected boolean checkComplex
protected boolean checkFixmes
protected JCheckBox prefCheckKeys
protected JCheckBox prefCheckValues
protected JCheckBox prefCheckComplex
protected JCheckBox prefCheckFixmes
protected JCheckBox prefCheckPaint
protected JCheckBox prefCheckKeysBeforeUpload
protected JCheckBox prefCheckValuesBeforeUpload
protected JCheckBox prefCheckComplexBeforeUpload
protected JCheckBox prefCheckFixmesBeforeUpload
protected JCheckBox prefCheckPaintBeforeUpload
protected JCheckBox prefUseDataFile
protected JCheckBox prefUseIgnoreFile
protected JCheckBox prefUseSpellFile
protected JButton addSrcButton
protected JButton editSrcButton
protected 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 JList sourcesList
public TagChecker()
public void initialize() throws IOException
Test
initialize
in class Test
IOException
private static void initializeData() throws IOException
FileNotFoundException
IOException
public static void initializePresets()
private static void addPresetValue(TaggingPreset p, TaggingPresetItems.KeyedItem ky)
public void visit(Node n)
Visitor
public void visit(Relation n)
Visitor
private boolean containsLow(String s)
s
- string to checkprivate void checkPrimitive(OsmPrimitive p)
p
- The primitive to checkpublic void startTest(ProgressMonitor monitor)
Test
public void visit(Collection<OsmPrimitive> selection)
Test
public void addGui(JPanel testPanel)
Test
public void handlePrefEnable()
public boolean ok()
Test
public Command fixError(TestError testError)
Test