com.sun.msv.relaxns.reader
Class RELAXNSReader

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--com.sun.msv.reader.GrammarReader
              |
              +--com.sun.msv.reader.relax.RELAXReader
                    |
                    +--com.sun.msv.relaxns.reader.RELAXNSReader
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, IDContextProvider, ValidationContext, XMLFilter, XMLReader

public class RELAXNSReader
extends RELAXReader

parses RELAX Namespace XML and constructs a SchemaProvider.

Author:
Kohsuke KAWAGUCHI

Inner classes inherited from class com.sun.msv.reader.relax.RELAXReader
RELAXReader.StateFactory
 
Inner classes inherited from class com.sun.msv.reader.GrammarReader
GrammarReader.BackPatch, GrammarReader.BackwardReferenceMap, GrammarReader.ChainPrefixResolver, GrammarReader.PrefixResolver
 
Field Summary
static String ERR_INLINEMODULE_NOT_FOUND
           
static String ERR_NAMESPACE_COLLISION
           
static String ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE
           
static String ERR_UNKNOWN_LANGUAGE
           
 RELAXGrammar grammar
          RELAX grammar that is currentlt being loaded
static String RELAXNamespaceNamespace
          namespace URI of RELAX Namespace.
static String WRN_ILLEGAL_RELAXNAMESPACE_VERSION
           
 
Fields inherited from class com.sun.msv.reader.relax.RELAXReader
ERR_ILLEGAL_OCCURS, ERR_MISPLACED_OCCURS, RELAXCoreNamespace, sfactory
 
Fields inherited from class com.sun.msv.reader.GrammarReader
backwardReference, basePrefixResolver, controller, ERR_BAD_ATTRIBUTE_VALUE, ERR_BAD_TYPE, ERR_CHARACTERS, ERR_CONFLICTING_ATTRIBUTES, ERR_DATATYPE_ALREADY_DEFINED, ERR_DISALLOWED_ATTRIBUTE, ERR_ILLEGAL_FINAL_VALUE, ERR_IO_EXCEPTION, ERR_MALPLACED_ELEMENT, ERR_MISSING_ATTRIBUTE, ERR_MISSING_ATTRIBUTE_2, ERR_MISSING_CHILD_EXPRESSION, ERR_MISSING_CHILD_TYPE, ERR_MISSING_TOPLEVEL, ERR_MORE_THAN_ONE_CHILD_EXPRESSION, ERR_MORE_THAN_ONE_CHILD_TYPE, ERR_RECURSIVE_DATATYPE, ERR_RECURSIVE_INCLUDE, ERR_RUNAWAY_EXPRESSION, ERR_SAX_EXCEPTION, ERR_UNDEFINED_DATATYPE, ERR_XMLPARSERFACTORY_EXCEPTION, hadError, locator, parserFactory, pool, prefixResolver, WRN_DEPRECATED_TYPENAME, WRN_MAYBE_WRONG_NAMESPACE
 
Constructor Summary
RELAXNSReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool)
           
 
Method Summary
 IslandSchemaReader getIslandSchemaReader(String language, String expectedTargetNamespace)
          creates an IslandSchemaReader that can parse the specified language.
 RELAXGrammar getResult()
          obtains parsed grammar object only if parsing was successful.
 Grammar getResultAsGrammar()
          gets the parsed AGM.
 SchemaProvider getSchemaProvider()
          obtains parsed grammar object as SchemaProvider only if parsing was successful.
static RELAXGrammar parse(InputSource module, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)
          loads RELAX grammar
static RELAXGrammar parse(String moduleURL, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)
          loads RELAX grammar
 Datatype resolveDataType(String typeName)
          gets DataType object from type name.
 
Methods inherited from class com.sun.msv.reader.relax.RELAXReader
createExpressionChildState, createFacetState
 
Methods inherited from class com.sun.msv.reader.GrammarReader
addBackPatchJob, combineURL, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getCurrentState, getDeclaredLocationOf, isNotation, isUnparsedEntity, onID, onIDREF, parse, parse, popState, pushState, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportWarning, reportWarning, reportWarning, resolveLocation, resolveNamespacePrefix, setDeclaredLocationOf, setDocumentLocator, splitQName, startPrefixMapping, switchSource
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endElement, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startElement, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELAXNamespaceNamespace

public static final String RELAXNamespaceNamespace
namespace URI of RELAX Namespace.

grammar

public final RELAXGrammar grammar
RELAX grammar that is currentlt being loaded

WRN_ILLEGAL_RELAXNAMESPACE_VERSION

public static final String WRN_ILLEGAL_RELAXNAMESPACE_VERSION

ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE

public static final String ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE

ERR_INLINEMODULE_NOT_FOUND

public static final String ERR_INLINEMODULE_NOT_FOUND

ERR_UNKNOWN_LANGUAGE

public static final String ERR_UNKNOWN_LANGUAGE

ERR_NAMESPACE_COLLISION

public static final String ERR_NAMESPACE_COLLISION
Constructor Detail

RELAXNSReader

public RELAXNSReader(GrammarReaderController controller,
                     javax.xml.parsers.SAXParserFactory parserFactory,
                     ExpressionPool pool)
Method Detail

parse

public static RELAXGrammar parse(String moduleURL,
                                 javax.xml.parsers.SAXParserFactory factory,
                                 GrammarReaderController controller,
                                 ExpressionPool pool)
loads RELAX grammar

parse

public static RELAXGrammar parse(InputSource module,
                                 javax.xml.parsers.SAXParserFactory factory,
                                 GrammarReaderController controller,
                                 ExpressionPool pool)
loads RELAX grammar

getResult

public final RELAXGrammar getResult()
obtains parsed grammar object only if parsing was successful.

getResultAsGrammar

public Grammar getResultAsGrammar()
Description copied from class: GrammarReader
gets the parsed AGM. Should any error happens, this method returns null. derived classes should implement type-safe getGrammar method, along with this method.
Overrides:
getResultAsGrammar in class GrammarReader

getSchemaProvider

public final SchemaProvider getSchemaProvider()
obtains parsed grammar object as SchemaProvider only if parsing was successful.

getIslandSchemaReader

public IslandSchemaReader getIslandSchemaReader(String language,
                                                String expectedTargetNamespace)
creates an IslandSchemaReader that can parse the specified language. This method can be overrided by the derived class to incorporate other language implementations.
Returns:
return null if the given language is unrecognized. error will be handled by the caller. So this method should not attempt to report nor recover from error.

resolveDataType

public Datatype resolveDataType(String typeName)
Description copied from class: GrammarReader
gets DataType object from type name. If undefined type name is specified, this method is responsible to report an error, and recover.
Overrides:
resolveDataType in class GrammarReader
Following copied from class: com.sun.msv.reader.GrammarReader
Parameters:
typeName - For RELAX, this is unqualified type name. For TREX, this is a QName.