public class OsmValidator extends java.lang.Object implements MapView.LayerChangeListener
Modifier and Type | Field and Description |
---|---|
private static java.lang.Class<Test>[] |
allAvailableTests
All available tests
TODO: is there any way to find out automatically all available tests?
|
private static java.util.Map<java.lang.String,Test> |
allTestsMap |
static ValidatorLayer |
errorLayer |
static double |
griddetail
Grid detail, multiplier of east,north values for valuable cell sizing
|
private static java.util.Collection<java.lang.String> |
ignoredErrors |
private static boolean |
testsInitialized |
ValidateAction |
validateAction
The validate action
|
Constructor and Description |
---|
OsmValidator()
Constructs a new
OsmValidator . |
Modifier and Type | Method and Description |
---|---|
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed.
|
static void |
addIgnoredError(java.lang.String s) |
private static void |
applyPrefs(java.util.Map<java.lang.String,Test> tests,
boolean beforeUpload) |
private static void |
checkValidatorDir()
Check if plugin directory exists (store ignored errors file)
|
static java.lang.Class<Test>[] |
getAllAvailableTests()
Gets the list of all available test classes
|
static java.util.SortedMap<java.lang.String,Test> |
getAllTestsMap()
Gets a map from simple names to all tests.
|
static java.util.Collection<Test> |
getEnabledTests(boolean beforeUpload) |
static <T extends Test> |
getTest(java.lang.Class<T> testClass)
Returns the instance of the given test class.
|
static java.util.Collection<Test> |
getTests() |
static java.lang.String |
getValidatorDir()
Returns the validator directory.
|
static boolean |
hasIgnoredError(java.lang.String s) |
static void |
initializeErrorLayer() |
static void |
initializeGridDetail()
Initialize grid details based on current projection system.
|
static void |
initializeTests()
Initializes all tests if this operations hasn't been performed already.
|
static void |
initializeTests(java.util.Collection<? extends Test> allTests)
Initializes all tests
|
void |
layerAdded(Layer newLayer)
Notifies this listener that a layer has been added.
|
void |
layerRemoved(Layer oldLayer)
Notifies this listener that a layer has been removed.
|
private static void |
loadIgnoredErrors() |
static void |
saveIgnoredErrors() |
public static volatile ValidatorLayer errorLayer
public ValidateAction validateAction
public static double griddetail
private static final java.util.Collection<java.lang.String> ignoredErrors
private static final java.lang.Class<Test>[] allAvailableTests
private static java.util.Map<java.lang.String,Test> allTestsMap
private static boolean testsInitialized
public OsmValidator()
OsmValidator
.public static java.lang.String getValidatorDir()
private static void checkValidatorDir()
private static void loadIgnoredErrors()
public static void addIgnoredError(java.lang.String s)
public static boolean hasIgnoredError(java.lang.String s)
public static void saveIgnoredErrors()
public static void initializeErrorLayer()
public static java.util.SortedMap<java.lang.String,Test> getAllTestsMap()
public static <T extends Test> T getTest(java.lang.Class<T> testClass)
T
- testClass typetestClass
- The class of test to retrievenull
private static void applyPrefs(java.util.Map<java.lang.String,Test> tests, boolean beforeUpload)
public static java.util.Collection<Test> getEnabledTests(boolean beforeUpload)
public static java.lang.Class<Test>[] getAllAvailableTests()
public static final void initializeGridDetail()
public static void initializeTests()
public static void initializeTests(java.util.Collection<? extends Test> allTests)
allTests
- The tests to initializepublic void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListener
activeLayerChange
in interface MapView.LayerChangeListener
oldLayer
- The previous active layernewLayer
- The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListener
layerAdded
in interface MapView.LayerChangeListener
newLayer
- The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListener
layerRemoved
in interface MapView.LayerChangeListener
oldLayer
- The old removed layer