Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.msv.reader.relax.core
Class RELAXCoreReader

    java.lang.Object
      org.xml.sax.helpers.XMLFilterImpl
          com.sun.msv.reader.GrammarReader
              com.sun.msv.reader.relax.RELAXReader
                  com.sun.msv.reader.relax.core.RELAXCoreReader

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, IDContextProvider2, ValidationContext, org.xml.sax.XMLFilter, org.xml.sax.XMLReader, XSDatatypeResolver

Direct Known Subclasses:
  RELAXCoreIslandSchemaReader

public class RELAXCoreReader
extends RELAXReader
implements XSDatatypeResolver

reads RELAX module (classic RELAX module; no namespace extension) by SAX2 and constructs abstract grammar model. This class does not recognize extensions introduced by RELAX Namespace (like anyOtherElement, or <ref label="..." namespace="..." />.

Author:
  Kohsuke KAWAGUCHI

Nested Class Summary
`static class` | `RELAXCoreReader.StateFactory`

Nested classes inherited from class com.sun.msv.reader.GrammarReader
`GrammarReader.BackPatch, GrammarReader.BackwardReferenceMap, GrammarReader.ChainPrefixResolver, GrammarReader.PrefixResolver`

Field Summary
`static java.lang.String` | `ERR_EXPROTED_HEDGERULE_CONSTRAINT`
`static java.lang.String` | `ERR_ID_ABUSE`
`static java.lang.String` | `ERR_ID_ABUSE_1`
`static java.lang.String` | `ERR_INCONSISTENT_TARGET_NAMESPACE`
`static java.lang.String` | `ERR_LABEL_COLLISION`
`static java.lang.String` | `ERR_MISSING_TARGET_NAMESPACE`
`static java.lang.String` | `ERR_MORE_THAN_ONE_INLINE_TAG`
`static java.lang.String` | `ERR_MULTIPLE_ATTPOOL_DECLARATIONS`
`static java.lang.String` | `ERR_MULTIPLE_ATTRIBUTE_CONSTRAINT`
`static java.lang.String` | `ERR_MULTIPLE_TAG_DECLARATIONS`
`static java.lang.String` | `ERR_NAMESPACE_NOT_SUPPROTED`
`static java.lang.String` | `ERR_ROLE_COLLISION`
`static java.lang.String` | `ERR_UNDEFINED_ATTPOOL`
`static java.lang.String` | `ERR_UNDEFINED_ELEMENTRULE`
`static java.lang.String` | `ERR_UNDEFINED_HEDGERULE`
`static java.lang.String` | `ERR_UNDEFINED_TAG`
`static java.lang.String` | `WRN_ILLEGAL_RELAXCORE_VERSION`
`static java.lang.String` | `WRN_NO_EXPROTED_LABEL`

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_FRAGMENT_IDENTIFIER, ERR_ILLEGAL_FINAL_VALUE, 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_UNDEFINED_DATATYPE, locator, parserFactory, pool, prefixResolver, WRN_DEPRECATED_TYPENAME, WRN_MAYBE_WRONG_NAMESPACE`

Constructor Summary
`RELAXCoreReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool)`
`RELAXCoreReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, RELAXCoreReader.StateFactory stateFactory, ExpressionPool pool, java.lang.String expectedTargetNamespace)` full constructor.

Method Summary
`void` | `addUserDefinedType(XSDatatypeExp exp)`
`State` | `createExpressionChildState(State parent, StartTagInfo tag)` this method must be implemented by the derived class to create language-default expresion state.
`static org.iso_relax.verifier.Schema` | `getRELAXCoreSchema4Schema()`
`RELAXModule` | `getResult()` obtains parsed grammar object only if parsing was successful.
`Grammar` | `getResultAsGrammar()` gets the parsed AGM.
`static RELAXModule` | `parse(org.xml.sax.InputSource module, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)` loads RELAX module
`static RELAXModule` | `parse(java.lang.String moduleURL, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller, ExpressionPool pool)` loads RELAX module
`XSDatatypeExp` | `resolveXSDatatype(java.lang.String typeName)` gets DataType object from type name.

Methods inherited from class com.sun.msv.reader.relax.RELAXReader
`createFacetState`

Methods inherited from class com.sun.msv.reader.GrammarReader
`_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, isNotation, isUnparsedEntity, iterateInscopeNamespaces, onID, parse, parse, popState, pushState, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportWarning, reportWarning, reportWarning, reportWarning, resolveLocation, resolveNamespacePrefix, runBackPatchJob, setDeclaredLocationOf, setDocumentLocator, splitQName, startPrefixMapping, switchSource, 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

### ERR_NAMESPACE_NOT_SUPPROTED

    public static final java.lang.String ERR_NAMESPACE_NOT_SUPPROTED

See Also:
  Constant Field Values

### ERR_INCONSISTENT_TARGET_NAMESPACE

    public static final java.lang.String ERR_INCONSISTENT_TARGET_NAMESPACE

See Also:
  Constant Field Values

### ERR_MISSING_TARGET_NAMESPACE

    public static final java.lang.String ERR_MISSING_TARGET_NAMESPACE

See Also:
  Constant Field Values

### ERR_MULTIPLE_TAG_DECLARATIONS

    public static final java.lang.String ERR_MULTIPLE_TAG_DECLARATIONS

See Also:
  Constant Field Values

### ERR_MORE_THAN_ONE_INLINE_TAG

    public static final java.lang.String ERR_MORE_THAN_ONE_INLINE_TAG

See Also:
  Constant Field Values

### ERR_MULTIPLE_ATTPOOL_DECLARATIONS

    public static final java.lang.String ERR_MULTIPLE_ATTPOOL_DECLARATIONS

See Also:
  Constant Field Values

### ERR_UNDEFINED_ELEMENTRULE

    public static final java.lang.String ERR_UNDEFINED_ELEMENTRULE

See Also:
  Constant Field Values

### ERR_UNDEFINED_HEDGERULE

    public static final java.lang.String ERR_UNDEFINED_HEDGERULE

See Also:
  Constant Field Values

### ERR_UNDEFINED_TAG

    public static final java.lang.String ERR_UNDEFINED_TAG

See Also:
  Constant Field Values

### ERR_UNDEFINED_ATTPOOL

    public static final java.lang.String ERR_UNDEFINED_ATTPOOL

See Also:
  Constant Field Values

### ERR_LABEL_COLLISION

    public static final java.lang.String ERR_LABEL_COLLISION

See Also:
  Constant Field Values

### ERR_ROLE_COLLISION

    public static final java.lang.String ERR_ROLE_COLLISION

See Also:
  Constant Field Values

### WRN_NO_EXPROTED_LABEL

    public static final java.lang.String WRN_NO_EXPROTED_LABEL

See Also:
  Constant Field Values

### ERR_EXPROTED_HEDGERULE_CONSTRAINT

    public static final java.lang.String ERR_EXPROTED_HEDGERULE_CONSTRAINT

See Also:
  Constant Field Values

### ERR_MULTIPLE_ATTRIBUTE_CONSTRAINT

    public static final java.lang.String ERR_MULTIPLE_ATTRIBUTE_CONSTRAINT

See Also:
  Constant Field Values

### ERR_ID_ABUSE

    public static final java.lang.String ERR_ID_ABUSE

See Also:
  Constant Field Values

### ERR_ID_ABUSE_1

    public static final java.lang.String ERR_ID_ABUSE_1

See Also:
  Constant Field Values

### WRN_ILLEGAL_RELAXCORE_VERSION

    public static final java.lang.String WRN_ILLEGAL_RELAXCORE_VERSION

See Also:
  Constant Field Values

Constructor Detail

### RELAXCoreReader

    public RELAXCoreReader(GrammarReaderController controller,
                           javax.xml.parsers.SAXParserFactory parserFactory,
                           ExpressionPool pool)

### RELAXCoreReader

    public RELAXCoreReader(GrammarReaderController controller,
                           javax.xml.parsers.SAXParserFactory parserFactory,
                           RELAXCoreReader.StateFactory stateFactory,
                           ExpressionPool pool,
                           java.lang.String expectedTargetNamespace)

  full constructor.

Parameters:
  `stateFactory` - this object creates all parsing state object. Parsing behavior can be modified by changing this object.
  `expectedTargetNamespace` - expected value of 'targetNamespace' attribute. If this value is null, then the module must have 'targetNamepsace' attribute. If this value is non-null and module doesn't have targetNamespace attribute, then expectedTargetNamespace is used as the module's target namespace (chameleon effect). If expectedNamespace differs from the module's targetNamespace attribute, then an error will be issued.

Method Detail

### parse

    public static RELAXModule parse(java.lang.String moduleURL,
                                    javax.xml.parsers.SAXParserFactory factory,
                                    GrammarReaderController controller,
                                    ExpressionPool pool)

  loads RELAX module

### parse

    public static RELAXModule parse(org.xml.sax.InputSource module,
                                    javax.xml.parsers.SAXParserFactory factory,
                                    GrammarReaderController controller,
                                    ExpressionPool pool)

  loads RELAX module

### getRELAXCoreSchema4Schema

    public static org.iso_relax.verifier.Schema getRELAXCoreSchema4Schema()

### getResult

    public final RELAXModule getResult()

  obtains parsed grammar object only if parsing was successful.

### getResultAsGrammar

    public final Grammar getResultAsGrammar()

  Description copied from class: `GrammarReader`
  gets the parsed AGM. Should any error happens, this method should returns null. derived classes should implement type-safe getGrammar method, along with this method.

  Specified by:
    `getResultAsGrammar` in class `GrammarReader`

### addUserDefinedType

    public final void addUserDefinedType(XSDatatypeExp exp)

### resolveXSDatatype

    public XSDatatypeExp resolveXSDatatype(java.lang.String typeName)

  gets DataType object from type name. If undefined type name is specified, this method is responsible to report an error, and recovers.

  Specified by:
    `resolveXSDatatype` in interface `XSDatatypeResolver`
  Parameters:
    `typeName` - The type of this value varies in the schema language. In XML Schema, for example, in which QNames are used to designate datatypes, this parameter will be QName. In RELAX Core, in which the same syntax is used but NCName is used to designate datatypes. So this parameter will be NCName.
  Returns:
    A non-null valid object. An error should be reported and recovered by the callee.

### createExpressionChildState

    public State createExpressionChildState(State parent,
                                            StartTagInfo tag)

  Description copied from class: `GrammarReader`
  this method must be implemented by the derived class to create language-default expresion state.

  Overrides:
    `createExpressionChildState` in class `RELAXReader`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD