org.apache.cocoon.components.validation.jaxp
Class JaxpSchema

java.lang.Object
  extended by org.apache.cocoon.components.validation.impl.AbstractSchema
      extended by org.apache.cocoon.components.validation.jaxp.JaxpSchema
All Implemented Interfaces:
Schema

public class JaxpSchema
extends AbstractSchema

An extension of the AbstractSchema class specific to the JaxpSchemaParser implementation.


Constructor Summary
JaxpSchema(javax.xml.validation.Schema schema, SourceValidity validity)
          Create a new JaxpSchema instance.
 
Method Summary
 ValidationHandler createValidator(ErrorHandler handler)
          Return a new ValidationHandler instance that can be used to validate an XML document by sending SAX events to it.
 
Methods inherited from class org.apache.cocoon.components.validation.impl.AbstractSchema
getValidity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxpSchema

public JaxpSchema(javax.xml.validation.Schema schema,
                  SourceValidity validity)

Create a new JaxpSchema instance.

Parameters:
schema - the Schema instance to wrap.
validity - the SourceValidity associated with the schema.
Method Detail

createValidator

public ValidationHandler createValidator(ErrorHandler handler)
                                  throws SAXException

Return a new ValidationHandler instance that can be used to validate an XML document by sending SAX events to it.

The specified ErrorHandler will be notified of all warnings or errors encountered validating the SAX events sent to the returned ValidationHandler, and must not be null.

The returned ValidationHandler can be used to validate only one XML document. To validate more than one document, this method should be called once for each document to validate.

Parameters:
handler - an ErrorHandler to notify of validation errors.
Returns:
a non-null ValidationHandler instance.
Throws:
SAXException - if an error occurred creating the validation handler.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.