This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.test
Class AbstractDocumentValidator

java.lang.Object
  extended by fiftyfive.wicket.test.AbstractDocumentValidator
All Implemented Interfaces:
ErrorHandler
Direct Known Subclasses:
Html5Validator, XHtmlValidator

public abstract class AbstractDocumentValidator
extends Object
implements ErrorHandler

Base class for XHTML and HTML5 validators.


Constructor Summary
AbstractDocumentValidator()
           
 
Method Summary
protected abstract  DocumentBuilder builder()
          Construct a validating DocumentBuilder with this registered as the error handler.
 void error(SAXParseException exception)
           
 void fatalError(SAXParseException exception)
           
 Document getDocument()
           
 List<String> getErrors()
          Returns the errors and warnings that were encountered in the previous call to parse(java.lang.String), if any.
 boolean isValid()
          Returns true if the previous call to parse(java.lang.String) completed without errors or warnings.
 void parse(String document)
          Parses a document provided as a String.
 void setNumLinesContext(int newNumLinesContext)
          Sets the number of lines of context that will be listed along with the line that has the validation error.
 void warning(SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDocumentValidator

public AbstractDocumentValidator()
Method Detail

setNumLinesContext

public void setNumLinesContext(int newNumLinesContext)
Sets the number of lines of context that will be listed along with the line that has the validation error. Must be positive. The default is 10.


parse

public void parse(String document)
           throws IOException
Parses a document provided as a String. To test whether the document was parsed successfully and is valid, subsequently call isValid().

Throws:
IOException

isValid

public boolean isValid()
Returns true if the previous call to parse(java.lang.String) completed without errors or warnings.


getDocument

public Document getDocument()

getErrors

public List<String> getErrors()
Returns the errors and warnings that were encountered in the previous call to parse(java.lang.String), if any.


error

public void error(SAXParseException exception)
Specified by:
error in interface ErrorHandler

fatalError

public void fatalError(SAXParseException exception)
Specified by:
fatalError in interface ErrorHandler

warning

public void warning(SAXParseException exception)
Specified by:
warning in interface ErrorHandler

builder

protected abstract DocumentBuilder builder()
Construct a validating DocumentBuilder with this registered as the error handler. This is the parsing and validation strategy that will be used. Subclasses should provide the appropriate XHTML or HTML5 implementation.



Copyright © 2011 55 Minutes. All Rights Reserved.