com.oxygenxml.validate.isoschematron
Class ValidatorImpl

java.lang.Object
  extended by com.thaiopensource.xml.sax.DelegatingContentHandler
      extended by com.oxygenxml.validate.isoschematron.ValidatorImpl
All Implemented Interfaces:
Validator, ContentHandler

 class ValidatorImpl
extends DelegatingContentHandler
implements Validator


Nested Class Summary
(package private)  class ValidatorImpl.BlockingReader
           
 
Field Summary
private  Object contentHandlerMonitor
           
private  Locator locator
           
private  ContentHandler outputHandler
           
private  Object parseMonitor
           
private  Transformer transformer
           
private  TransformerException transformerException
           
private  Object transformMonitor
           
private  Thread transformThread
           
 
Constructor Summary
ValidatorImpl(Templates templates, PropertyMap properties)
           
 
Method Summary
 void endDocument()
           
 ContentHandler getContentHandler()
          Returns the ContentHandler that will receive the XML document.
 DTDHandler getDTDHandler()
          Returns a DTDHandler.
 void reset()
          Cleans up after validating a document.
 void setDocumentLocator(Locator locator)
           
 void startDocument()
           
(package private) static SAXException toSAXException(TransformerException transformerException)
           
 
Methods inherited from class com.thaiopensource.xml.sax.DelegatingContentHandler
characters, endElement, endPrefixMapping, getDelegate, ignorableWhitespace, processingInstruction, setDelegate, skippedEntity, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformer

private final Transformer transformer

locator

private Locator locator

transformerException

private TransformerException transformerException

contentHandlerMonitor

private final Object contentHandlerMonitor

parseMonitor

private final Object parseMonitor

transformMonitor

private final Object transformMonitor

transformThread

private Thread transformThread

outputHandler

private final ContentHandler outputHandler
Constructor Detail

ValidatorImpl

ValidatorImpl(Templates templates,
              PropertyMap properties)
Method Detail

getContentHandler

public ContentHandler getContentHandler()
Description copied from interface: Validator
Returns the ContentHandler that will receive the XML document. Information about the XML document to be validated must be reported by calling methods on the returned ContentHandler. When validation of an XML document has been completed (either endDocument() has been called or validation has been abandoned prematurely), reset() must be called. If no calls are made on the ContentHandler, then reset() need not be called. Implementations should allocate resources that require cleanup (e.g. threads, open files) lazily, typically in startDocument(). This method does not change the state of the Validator: the same object will always be returned unless reset is called.

Specified by:
getContentHandler in interface Validator
Returns:
a ContentHandler, never null
See Also:
Validator.reset()

getDTDHandler

public DTDHandler getDTDHandler()
Description copied from interface: Validator
Returns a DTDHandler. Information about the DTD must be reported by calling methods on the returned object, unless null is returned. The same object will always be returned unless reset is called: this method does not change the state of the Validator.

Specified by:
getDTDHandler in interface Validator
Returns:
a DTDHandler, maybe null if DTD information is not significant to the Validator

reset

public void reset()
Description copied from interface: Validator
Cleans up after validating a document. After completing validation of a document, reset must be called. After calling reset(), another document may be validated. Calling this method may create new ContentHandler and DTDHandler objects or may simply reinitialize the state of the existing objects.

Specified by:
reset in interface Validator

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class DelegatingContentHandler

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DelegatingContentHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DelegatingContentHandler
Throws:
SAXException

toSAXException

static SAXException toSAXException(TransformerException transformerException)