Package org.apache.any23.validator
Class DefaultValidator
- java.lang.Object
-
- org.apache.any23.validator.DefaultValidator
-
-
Constructor Summary
Constructors Constructor Description DefaultValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRule(Class<? extends Rule> rule)Allows to register a new rule to this validatorvoidaddRule(Class<? extends Rule> rule, Class<? extends Fix> fix)Allows to register a new rule to this validator and associating it to a fix.List<Class<? extends Rule>>getAllRules()Returns all the registered rules.List<Class<? extends Fix>>getFixes(Class<? extends Rule> rule)Returns all fixes registered for the give rule.voidremoveRule(Class<? extends Rule> rule)Allows to remove a rule from the validator and all the relatedFixes.ValidationReportvalidate(URI documentIRI, Document document, boolean applyFix)Performs a validation - fixing of the provided document.ValidationReportvalidate(DOMDocument document, boolean applyFix)Performs a validation - fixing of the provided document.
-
-
-
Method Detail
-
validate
public ValidationReport validate(DOMDocument document, boolean applyFix) throws ValidatorException
Description copied from interface:ValidatorPerforms a validation - fixing of the provided document.- Specified by:
validatein interfaceValidator- Parameters:
document- theDOMDocumentinstance wrapping the original HTML document.applyFix- iftruetries to fix the document.- Returns:
- a report of the detected issues.
- Throws:
ValidatorException- if an error occurs during the validation process.
-
validate
public ValidationReport validate(URI documentIRI, Document document, boolean applyFix) throws ValidatorException
Description copied from interface:ValidatorPerforms a validation - fixing of the provided document.- Specified by:
validatein interfaceValidator- Parameters:
documentIRI- the document source IRI.document- the original HTML document.applyFix- iftruetries to fix the document.- Returns:
- a report of the detected issues.
- Throws:
ValidatorException- if an error occurs during the validation process.
-
addRule
public void addRule(Class<? extends Rule> rule, Class<? extends Fix> fix)
Description copied from interface:ValidatorAllows to register a new rule to this validator and associating it to a fix.
-
addRule
public void addRule(Class<? extends Rule> rule)
Description copied from interface:ValidatorAllows to register a new rule to this validator
-
removeRule
public void removeRule(Class<? extends Rule> rule)
Description copied from interface:ValidatorAllows to remove a rule from the validator and all the relatedFixes.- Specified by:
removeRulein interfaceValidator- Parameters:
rule-Ruleto remove
-
getAllRules
public List<Class<? extends Rule>> getAllRules()
Description copied from interface:ValidatorReturns all the registered rules.- Specified by:
getAllRulesin interfaceValidator- Returns:
- a not null list of rules.
-
-