[bug 486980] add JavaDocs to describe how to compose validators

This commit is contained in:
Trabajo 2016-02-19 17:01:20 +01:00
parent 5dd3aaf971
commit 0319d7a2b8
2 changed files with 9 additions and 0 deletions

View file

@ -73,6 +73,10 @@ public abstract class AbstractInjectableValidator implements EValidator {
protected abstract boolean internalValidate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context);
/**
* If this validator is for an EPackage you want to use in multiple languages,
* this method should return false. Otherwise issues will be reported twice.
*/
public boolean isLanguageSpecific() {
return languageName != null;
}

View file

@ -13,6 +13,11 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation that allows to modularize the validator into multiple classes.
*
* The listed validators should override the method {@link AbstractDeclarativeValidator#register(EValidatorRegistrar)}
* with an empty implementation otherwise all issues will be reported twice.
*
* @author Sebastian Zarnekow - Initial contribution and API
*/
@Retention(RetentionPolicy.RUNTIME)