Class RELAXCoreReader

    • Field Detail

      • relaxCoreSchema4Schema

        protected static org.iso_relax.verifier.Schema relaxCoreSchema4Schema
        Schema for schema of RELAX Core. Unless overrided, this schema for schema will be used to parse a RELAX Core schema. To override, call the full constructor of this class and change the parameter.
      • module

        protected RELAXModule module
        RELAX module object being under construction. object is created when target namespace is identified.
      • combinedAttPools

        protected final ReferenceContainer combinedAttPools
        contains all expressions that are going to be combined. ReferenceExp is used to wrap an expression to provide location information. (attPool element with combine attribute).
    • Constructor Detail

      • RELAXCoreReader

        public RELAXCoreReader​(GrammarReaderController controller,
                               SAXParserFactory parserFactory,
                               RELAXCoreReader.StateFactory stateFactory,
                               ExpressionPool pool,
                               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

      • 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​(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.
      • canHaveOccurs

        protected boolean canHaveOccurs​(ExpressionState state)
        returns true if the given state can have "occurs" attribute.
      • resolveElementRef

        protected Expression resolveElementRef​(String namespace,
                                               String label)
        Description copied from class: RELAXReader
        obtains an Expression specified by given (namespace,label) pair. this method is called to parse <ref label="..." /> element.
        Specified by:
        resolveElementRef in class RELAXReader
      • resolveHedgeRef

        protected Expression resolveHedgeRef​(String namespace,
                                             String label)
        Description copied from class: RELAXReader
        obtains an Expression specified by given (namespace,label) pair. this method is called to parse <hedgeRef label="..." /> element.
        Specified by:
        resolveHedgeRef in class RELAXReader
      • wrapUp

        protected void wrapUp()