com.ctc.wstx.msv
Class RelaxNGSchemaFactory

java.lang.Object
  extended by org.codehaus.stax2.validation.XMLValidationSchemaFactory
      extended by com.ctc.wstx.msv.RelaxNGSchemaFactory

public class RelaxNGSchemaFactory
extends XMLValidationSchemaFactory

This is a StAX2 schema factory that can parse and create schema instances for creating validators that validate documents to check their validity against specific Relax NG specifications. It requires Sun Multi-Schema Validator (http://www.sun.com/software/xml/developers/multischema/) to work, and acts as a quite thin wrapper layer (although not a completely trivial one, since MSV only exports SAX API, some adapting is needed)


Field Summary
protected  ValidatorConfig mConfig
          Current configurations for this factory
protected  com.sun.msv.reader.GrammarReaderController mDummyController
          For now, there's no need for fine-grained error/problem reporting infrastructure, so let's just use a dummy controller.
protected  javax.xml.parsers.SAXParserFactory mSaxFactory
           
 
Fields inherited from class org.codehaus.stax2.validation.XMLValidationSchemaFactory
INTERNAL_ID_SCHEMA_DTD, INTERNAL_ID_SCHEMA_RELAXNG, INTERNAL_ID_SCHEMA_TREX, INTERNAL_ID_SCHEMA_W3C, P_ENABLE_CACHING, P_IS_NAMESPACE_AWARE, SERVICE_DEFINITION_PATH, SYSTEM_PROPERTY_FOR_IMPL
 
Constructor Summary
RelaxNGSchemaFactory()
           
 
Method Summary
 XMLValidationSchema createSchema(java.io.File f)
           
 XMLValidationSchema createSchema(java.io.InputStream in, java.lang.String encoding, java.lang.String publicId, java.lang.String systemId)
           
 XMLValidationSchema createSchema(java.io.Reader r, java.lang.String publicId, java.lang.String systemId)
           
 XMLValidationSchema createSchema(java.net.URL url)
           
 java.lang.Object getProperty(java.lang.String propName)
           
 boolean isPropertySupported(java.lang.String propName)
           
protected  XMLValidationSchema loadSchema(org.xml.sax.InputSource src, java.lang.Object sysRef)
           
 boolean setProperty(java.lang.String propName, java.lang.Object value)
           
 
Methods inherited from class org.codehaus.stax2.validation.XMLValidationSchemaFactory
createSchema, createSchema, createSchema, newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mSaxFactory

protected final javax.xml.parsers.SAXParserFactory mSaxFactory

mConfig

protected final ValidatorConfig mConfig
Current configurations for this factory


mDummyController

protected final com.sun.msv.reader.GrammarReaderController mDummyController
For now, there's no need for fine-grained error/problem reporting infrastructure, so let's just use a dummy controller.

Constructor Detail

RelaxNGSchemaFactory

public RelaxNGSchemaFactory()
Method Detail

isPropertySupported

public boolean isPropertySupported(java.lang.String propName)
Specified by:
isPropertySupported in class XMLValidationSchemaFactory

setProperty

public boolean setProperty(java.lang.String propName,
                           java.lang.Object value)
Specified by:
setProperty in class XMLValidationSchemaFactory
Parameters:
propName - Name of property to set
value - Value to set property to
Returns:
True if setting succeeded; false if property was recognized but could not be changed to specified value, or if it was not recognized but the implementation did not throw an exception.

getProperty

public java.lang.Object getProperty(java.lang.String propName)
Specified by:
getProperty in class XMLValidationSchemaFactory

createSchema

public XMLValidationSchema createSchema(java.io.InputStream in,
                                        java.lang.String encoding,
                                        java.lang.String publicId,
                                        java.lang.String systemId)
                                 throws javax.xml.stream.XMLStreamException
Specified by:
createSchema in class XMLValidationSchemaFactory
Throws:
javax.xml.stream.XMLStreamException

createSchema

public XMLValidationSchema createSchema(java.io.Reader r,
                                        java.lang.String publicId,
                                        java.lang.String systemId)
                                 throws javax.xml.stream.XMLStreamException
Specified by:
createSchema in class XMLValidationSchemaFactory
Throws:
javax.xml.stream.XMLStreamException

createSchema

public XMLValidationSchema createSchema(java.net.URL url)
                                 throws javax.xml.stream.XMLStreamException
Specified by:
createSchema in class XMLValidationSchemaFactory
Throws:
javax.xml.stream.XMLStreamException

createSchema

public XMLValidationSchema createSchema(java.io.File f)
                                 throws javax.xml.stream.XMLStreamException
Specified by:
createSchema in class XMLValidationSchemaFactory
Throws:
javax.xml.stream.XMLStreamException

loadSchema

protected XMLValidationSchema loadSchema(org.xml.sax.InputSource src,
                                         java.lang.Object sysRef)
                                  throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException