|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.validator.DefaultValidator
public class DefaultValidator
Default implementation of Validator
.
Constructor Summary | |
---|---|
DefaultValidator()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultValidator()
Method Detail |
---|
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
addRule
in interface Validator
public void addRule(Class<? extends Rule> rule)
Validator
addRule
in interface 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
public List<Class<? extends Fix>> getFixes(Class<? extends Rule> rule)
Validator
getFixes
in interface Validator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |