[josm-dev] Two patches for the Validator plugin

MP singularita at gmail.com
Sat Oct 10 21:16:51 BST 2009


>  http://josm.openstreetmap.de/ticket/3412 Check for missing name:* translations

So this is patch which adds another check in validator. This reminded
me of one idea - that validator plugin could have plugins itself.

Currently if you want to add new test, you write new class and then
you open OSMValidatorPlugin.java, find line with "public static
Class<Test>[] allAvailableTests = new Class[]" and add your test to
the list.

And then you can either wait for the check to be added to validator or
compile your version for yourself.

Perhaps if such extra checks could be packaged as separate plugin
(which would require validator as dependency), then if would be easier
to have some check specific to only small group of people (like
writing specific check for some data that are used only in some
country - for example some TIGER-specific checks are useful only for
people editing data in the USA, etc ...) since these probably won't
get to validator in SVN

Only things that would need to be resolved for that would be enforcing
plugin dependencies (that could be done at runtime in worst case) and
allowing plugins to interact with each other, so the new check could
add itself in validator. Something like:

Validator v=(Validator)Main.getPlugin("validator");
if (v=null) error("validator required");
if (v.getVersion()<12345) error("too old validator version");
v.addCheck(VerySpecialCheck.class);
v.addCheck(AnotherSpecialCheck.class);

Perhaps the dependency checking could be done in plugin manifest:

Plugin-name: validator-extra-check
Depends: validator>=12345

What is the oppinion on this?

Martin




More information about the josm-dev mailing list