public interface Validator
Document
instances.Modifier and Type | Method and Description |
---|---|
void |
addRule(Class<? extends Rule> rule)
Allows to register a new rule to this validator
|
void |
addRule(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.
|
void |
removeRule(Class<? extends Rule> rule)
Allows to remove a rule from the validator and all the related
Fix es. |
ValidationReport |
validate(DOMDocument document,
boolean applyFix)
Performs a validation - fixing of the provided document.
|
ValidationReport |
validate(URI documentURI,
Document document,
boolean applyFix)
Performs a validation - fixing of the provided document.
|
ValidationReport validate(DOMDocument document, boolean applyFix) throws ValidatorException
document
- the DOMDocument
instance wrapping the
original HTML document.applyFix
- if true
tries to fix the document.ValidatorException
- if an error occurs during the validation process.ValidationReport validate(URI documentURI, Document document, boolean applyFix) throws ValidatorException
documentURI
- the document source URI.document
- the original HTML document.applyFix
- if true
tries to fix the document.ValidatorException
- if an error occurs during the validation process.void addRule(Class<? extends Rule> rule)
rule
- void addRule(Class<? extends Rule> rule, Class<? extends Fix> fix)
rule
- fix
- void removeRule(Class<? extends Rule> rule)
Fix
es.rule
- List<Class<? extends Rule>> getAllRules()
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.