|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.DocumentValidator
A DocumentValidator validates a Document and throws
a DocumentValidationException with a descriptive error message
if it is deemend invalid. This abstract base class uses a variation of the
Chain of Command design pattern, so a sequence of document
validators can be chained together using the setSuccessor
method. The document passed to the first document validator's
validate method will then pass along the chain until either a
DocumentValidationException is raised or the end of the chain
is reached. Implementation classes must implement the abstract
performValidation method.
| Constructor Summary | |
DocumentValidator()
|
|
| Method Summary | |
protected abstract void |
performValidation(org.w3c.dom.Document request)
Validates the specified document and throws a DocumentValidationException with a desctiptive error message
if the document is invalid. |
void |
setSuccessor(DocumentValidator validator)
Sets the next DocumentValidator in the chain. |
void |
validate(org.w3c.dom.Document performDocument)
Validates the specified document then, if an exception has not been raised, passes it on to the next document validator in the chain, if the end of the chain has not been reached. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DocumentValidator()
| Method Detail |
public final void setSuccessor(DocumentValidator validator)
DocumentValidator in the chain.
validator - a DocumentValidator
public final void validate(org.w3c.dom.Document performDocument)
throws DocumentValidationException
performDocument - the document to validate
DocumentValidationException - if the document is invalid
protected abstract void performValidation(org.w3c.dom.Document request)
throws DocumentValidationException
DocumentValidationException with a desctiptive error message
if the document is invalid. This method must be implemented by
DocumentValidator implementations.
request - the document to validate
DocumentValidationException - if the document is invalid
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||