Constructor and Description |
---|
DefaultValidator() |
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.
|
public ValidationReport validate(DOMDocument document, boolean applyFix) throws ValidatorException
Validator
validate
in interface Validator
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.public ValidationReport validate(URI documentURI, Document document, boolean applyFix) throws ValidatorException
Validator
validate
in interface Validator
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.public void addRule(Class<? extends Rule> rule, Class<? extends Fix> fix)
Validator
public void addRule(Class<? extends Rule> rule)
Validator
public void removeRule(Class<? extends Rule> rule)
Validator
Fix
es.removeRule
in interface Validator
public List<Class<? extends Rule>> getAllRules()
Validator
getAllRules
in interface Validator
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.