hyphenType comes with two validator engines: CustomizableValidator and BooleanValidator. Although these two validators are highly customizable, it is possible that you may want to create your own validator engine.
Creating your own validator engine is relatively easy. All you need to do is to create a class that implements the ArgumentsProcessorEngine interface, and follow some simple rules.
As with documentation formatters, validator engines comprise two entities: the annotation and the engine itself.
Here are the rules a validator engine should follow. We will use the naming convention XEngine for the validator engine and X for the validator annotation.
public class XEngine implements ArgumentsProcessorEngine<XEngine.X>
A direct consequence of this rule is that X should have a method with the following signature:
@Override public <T extends Options<?>> void process(Class<T> interfaceClass, T options, X config)
Note that the instance of X is called "config" for a reason. This instance in fact holds the configuration for XEngine.
Having the @Override annotation is not mandatory but is a good practice.
In case you are wondering, yes, there is a difference between those two constructors: http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.9
This difference is irrelevant here. What is relevant is that if you explicitly add a constructor that accepts any argument to X, you will have no default constructor. Then you will need to correct this problem by adding a non-argument constructor to X.
Please check the source code of CustomizableValidator for an example of a validator source code.