Package com.sun.msv.reader.xmlschema
Class XMLSchemaReader
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- com.sun.msv.reader.GrammarReader
-
- com.sun.msv.reader.xmlschema.XMLSchemaReader
-
- All Implemented Interfaces:
IDContextProvider2,XSDatatypeResolver,org.relaxng.datatype.ValidationContext,org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler,org.xml.sax.XMLFilter,org.xml.sax.XMLReader
public class XMLSchemaReader extends GrammarReader implements XSDatatypeResolver
parses XML representation of XML Schema and constructs AGM.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceXMLSchemaReader.RefResolverstatic classXMLSchemaReader.StateFactorycreates various State object, which in turn parses grammar.private static interfaceXMLSchemaReader.Type-
Nested classes/interfaces inherited from class com.sun.msv.reader.GrammarReader
GrammarReader.BackPatch, GrammarReader.BackwardReferenceMap, GrammarReader.ChainPrefixResolver, GrammarReader.PrefixResolver
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>additionalNamespaceMapprotected java.lang.StringattributeFormDefaultvalue of the "attributeFormDefault" attribute.protected java.lang.StringblockDefaultvalue of the "blockDefault" attribute.protected java.lang.StringchameleonTargetNamespaceThe intended target namespace of the chameleon schema.ComplexTypeExpcomplexUrTypeexpression that matches to "ur-type" when used as a complex type.protected XMLSchemaSchemacurrentSchemaprivate java.util.Set<XMLSchemaSchema>definedSchemataset of XMLSchemaGrammar that is already defined.booleandoDuplicateDefinitionChecka flag that indicates State objects should check duplicate definitions.protected java.lang.StringelementFormDefaultvalue of the "elementFormDefault" attribute.static java.lang.StringERR_BAD_XPATHstatic java.lang.StringERR_DUPLICATE_ATTRIBUTE_DEFINITIONstatic java.lang.StringERR_DUPLICATE_ATTRIBUTE_GROUP_DEFINITIONstatic java.lang.StringERR_DUPLICATE_COMPLEXTYPE_DEFINITIONstatic java.lang.StringERR_DUPLICATE_ELEMENT_DEFINITIONstatic java.lang.StringERR_DUPLICATE_GROUP_DEFINITIONstatic java.lang.StringERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITIONstatic java.lang.StringERR_DUPLICATE_SCHEMA_DEFINITIONstatic java.lang.StringERR_IMPORTING_SAME_NAMESPACEstatic java.lang.StringERR_INCONSISTENT_TARGETNAMESPACEstatic java.lang.StringERR_INVALID_BASETYPE_FOR_SIMPLECONTENTstatic java.lang.StringERR_KEY_FIELD_NUMBER_MISMATCHstatic java.lang.StringERR_KEYREF_REFERRING_NON_KEYstatic java.lang.StringERR_MAXOCCURS_IS_NECESSARYstatic java.lang.StringERR_RECURSIVE_SUBSTITUTION_GROUPstatic java.lang.StringERR_REDEFINE_UNDEFINEDstatic java.lang.StringERR_UNDECLARED_PREFIXstatic java.lang.StringERR_UNDEFINED_ATTRIBUTE_DECLstatic java.lang.StringERR_UNDEFINED_ATTRIBUTE_GROUPstatic java.lang.StringERR_UNDEFINED_COMPLEX_OR_SIMPLE_TYPEstatic java.lang.StringERR_UNDEFINED_COMPLEX_TYPEstatic java.lang.StringERR_UNDEFINED_ELEMENT_DECLstatic java.lang.StringERR_UNDEFINED_ELEMENTTYPEstatic java.lang.StringERR_UNDEFINED_GROUPstatic java.lang.StringERR_UNDEFINED_KEYstatic java.lang.StringERR_UNDEFINED_OR_FORWARD_REFERENCED_TYPEstatic java.lang.StringERR_UNDEFINED_SCHEMAstatic java.lang.StringERR_UNDEFINED_SIMPLE_TYPEstatic java.lang.StringERR_UNIMPLEMENTED_FEATUREstatic java.lang.StringERR_UNRELATED_TYPES_IN_SUBSTITUTIONGROUPprotected java.lang.StringfinalDefaultvalue of the "finalDefault" attribute.protected XMLSchemaGrammargrammargrammar object which is being under construction.private booleanissuedOldNamespaceWarningjava.util.Map<java.lang.String,java.util.Set<java.lang.String>>parsedFilestables that store all SystemIds that we've read.XMLSchemaReader.StateFactorysfactorystatic java.lang.StringWRN_IMPLICIT_URTYPE_FOR_ELEMENTstatic java.lang.StringWRN_OBSOLETED_NAMESPACEstatic java.lang.StringWRN_UNSUPPORTED_ANYELEMENTprotected static org.iso_relax.verifier.SchemaxmlSchema4XmlSchemaSchema for schema of W3C XML Schema.static java.lang.StringXMLSchemaNamespacenamespace URI of XML Schema declarations.static java.lang.StringXMLSchemaNamespace_oldstatic java.lang.StringXMLSchemaSchemaLocationAttributesprotected XMLSchemaSchemaxsdSchemaXMLSchemaSchema object that has XMLSchemaNamespace as its target namespace.ReferenceExpxsiSchemaLocationExpcontent model that matches to optional xsi:schemaLocation or xsi:noNamespaceSchemaLocation.-
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, parserFactory, pool, prefixResolver, WRN_DEPRECATED_TYPENAME, WRN_MAYBE_WRONG_NAMESPACE
-
-
Constructor Summary
Constructors Constructor Description XMLSchemaReader(GrammarReaderController controller)easy-to-use constructor.XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory)XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool)XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, XMLSchemaReader.StateFactory stateFactory, ExpressionPool pool)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private Expression_processOccurs(Expression item, int minOccurs, int maxOccurs)StatecreateAttributeState(State parent, StartTagInfo tag)creates a state object that parses "attribute","attributeGroup ref", and "anyAttribute".StatecreateExpressionChildState(State parent, StartTagInfo tag)this method must be implemented by the derived class to create language-default expresion state.StatecreateFacetState(State parent, StartTagInfo tag)StatecreateModelGroupState(State parent, StartTagInfo tag)creates a state object that parses "all"/"group ref"/"choice" and "sequence".java.util.Map<java.lang.String,java.lang.String>getAdditionalNamespaceMap()XMLSchemaSchemagetOrCreateSchema(java.lang.String namespaceURI)gets a reference to XMLSchemaGrammar object whose target namespace is the specified one.XMLSchemaGrammargetResult()GrammargetResultAsGrammar()gets the parsed AGM.private XMLSchemaReader.TypegetType(XSDatatype dt)private XMLSchemaReader.TypegetType(XMLSchemaTypeExp exp)static org.iso_relax.verifier.SchemagetXmlSchemaForXmlSchema()protected ExpressioninterceptExpression(State state, Expression exp)intercepts an expression made by ExpressionState before it is passed to the parent state.protected booleanisGrammarElement(StartTagInfo tag)checks if given element is that of the grammar elements.booleanisSchemaDefined(XMLSchemaSchema schema)booleanisSchemaNamespace(java.lang.String ns)private booleanisSubstitutable(ElementDeclExp c, ElementDeclExp d)implementation of "SCC: Substitution Group OK (Transitive)".protected java.lang.StringlocalizeMessage(java.lang.String propertyName, java.lang.Object[] args)formats localized message with argumentsvoidmarkSchemaAsDefined(XMLSchemaSchema schema)static XMLSchemaGrammarparse(java.lang.String grammarURL, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)loads XML Schemastatic XMLSchemaGrammarparse(javax.xml.transform.Source schema, GrammarReaderController controller)Convenience method to create a reader and read a single scheme.static XMLSchemaGrammarparse(org.xml.sax.InputSource grammar, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)loads XML SchemaExpressionprocessOccurs(Expression item, int minOccurs, int maxOccurs)Adds maxOccurs/minOccurs semantics to a given expression.ExpressionprocessOccurs(StartTagInfo startTag, Expression item)Adds maxOccurs/minOccurs semantics to a given expression.XSDatatyperesolveBuiltinDataType(java.lang.String typeLocalName)resolves built-in datatypes (URI: http://www.w3.org/2001/XMLSchema)SimpleTypeExpresolveBuiltinSimpleType(java.lang.String typeLocalName)Gets a built-in datatype as SimpleTypeExp.protected java.lang.StringresolveNamespaceOfAttributeDecl(java.lang.String formValue)private java.lang.StringresolveNamespaceOfDeclaration(java.lang.String formValue, java.lang.String defaultValue)protected java.lang.StringresolveNamespaceOfElementDecl(java.lang.String formValue)ExpressionresolveQNameRef(StartTagInfo tag, java.lang.String attName, XMLSchemaReader.RefResolver resolver)XSDatatypeExpresolveXSDatatype(java.lang.String typeQName)Resolves a simple type name into the corresponding XSDatatypeExp object.voidsetAdditionalNamespaceMap(java.util.Map<java.lang.String,java.lang.String> additionalNamespaceMap)java.lang.String[]splitQName(java.lang.String qName)Resolves a QName into a pair of (namespace URI,local name).protected voidswitchSource(State sourceState, State newRootState)protected voidwrapUp()performs final wrap-up of parsing.-
Methods inherited from class com.sun.msv.reader.GrammarReader
_parse, addBackPatchJob, addBackPatchJob, combineURI, combineURL, createParserFactory, detectUndefinedOnes, endPrefixMapping, getBackwardCompatibleType, getBaseUri, getCurrentState, getDeclaredLocationOf, getLocator, inputSourceFromLSInput, isNotation, isUnparsedEntity, iterateInscopeNamespaces, onID, parse, parse, parse, popState, pushState, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportError, reportWarning, reportWarning, reportWarning, reportWarning, resolveLocation, resolveNamespacePrefix, runBackPatchJob, setDeclaredLocationOf, setDocumentLocator, setLocator, startPrefixMapping, switchSource, 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
-
-
-
-
Field Detail
-
additionalNamespaceMap
private java.util.Map<java.lang.String,java.lang.String> additionalNamespaceMap
-
xmlSchema4XmlSchema
protected static org.iso_relax.verifier.Schema xmlSchema4XmlSchema
Schema for schema of W3C XML Schema.
-
xsiSchemaLocationExp
public final ReferenceExp xsiSchemaLocationExp
content model that matches to optional xsi:schemaLocation or xsi:noNamespaceSchemaLocation.
-
XMLSchemaSchemaLocationAttributes
public static final java.lang.String XMLSchemaSchemaLocationAttributes
- See Also:
- Constant Field Values
-
complexUrType
public final ComplexTypeExp complexUrType
expression that matches to "ur-type" when used as a complex type.
-
attributeFormDefault
protected java.lang.String attributeFormDefault
value of the "attributeFormDefault" attribute.
-
elementFormDefault
protected java.lang.String elementFormDefault
value of the "elementFormDefault" attribute.
-
finalDefault
protected java.lang.String finalDefault
value of the "finalDefault" attribute. Set to null if the attribute was not specified.
-
blockDefault
protected java.lang.String blockDefault
value of the "blockDefault" attribute. Set to null if the attribute was not specified.
-
grammar
protected final XMLSchemaGrammar grammar
grammar object which is being under construction.
-
currentSchema
protected XMLSchemaSchema currentSchema
-
xsdSchema
protected final XMLSchemaSchema xsdSchema
XMLSchemaSchema object that has XMLSchemaNamespace as its target namespace.
-
parsedFiles
public final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> parsedFiles
tables that store all SystemIds that we've read. map from target namespace URI to set of system ids. This field is used to prevent double inclusion. Strictly speaking, comparision based on system id is not enough. The spec calls for "the necessity of establishing identity component by component" (section 4.2.1, last note).
-
sfactory
public final XMLSchemaReader.StateFactory sfactory
-
XMLSchemaNamespace
public static final java.lang.String XMLSchemaNamespace
namespace URI of XML Schema declarations.- See Also:
- Constant Field Values
-
XMLSchemaNamespace_old
public static final java.lang.String XMLSchemaNamespace_old
- See Also:
- Constant Field Values
-
issuedOldNamespaceWarning
private boolean issuedOldNamespaceWarning
-
definedSchemata
private final java.util.Set<XMLSchemaSchema> definedSchemata
set of XMLSchemaGrammar that is already defined. XMLSchemaGrammar object is created when it is first referenced or defined.
-
chameleonTargetNamespace
protected java.lang.String chameleonTargetNamespace
The intended target namespace of the chameleon schema.When parsing a chameleon schema (inclusion of a schema without the targetNamespace attribute), this field is set to the target namespace of the callee, so that any reference occured in the chameleon schema is treated correctly.
This field must be set to null in other cases. In that case, QName resolution is handled just normally.
This field is maintained by
SchemaIncludedState.
-
doDuplicateDefinitionCheck
public boolean doDuplicateDefinitionCheck
a flag that indicates State objects should check duplicate definitions. This flag is set to false when in <redefine>. Otherwise this flag is true.
-
ERR_MAXOCCURS_IS_NECESSARY
public static final java.lang.String ERR_MAXOCCURS_IS_NECESSARY
- See Also:
- Constant Field Values
-
ERR_UNIMPLEMENTED_FEATURE
public static final java.lang.String ERR_UNIMPLEMENTED_FEATURE
- See Also:
- Constant Field Values
-
ERR_UNDECLARED_PREFIX
public static final java.lang.String ERR_UNDECLARED_PREFIX
- See Also:
- Constant Field Values
-
ERR_INCONSISTENT_TARGETNAMESPACE
public static final java.lang.String ERR_INCONSISTENT_TARGETNAMESPACE
- See Also:
- Constant Field Values
-
ERR_IMPORTING_SAME_NAMESPACE
public static final java.lang.String ERR_IMPORTING_SAME_NAMESPACE
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_SCHEMA_DEFINITION
public static final java.lang.String ERR_DUPLICATE_SCHEMA_DEFINITION
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_ELEMENTTYPE
public static final java.lang.String ERR_UNDEFINED_ELEMENTTYPE
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_ATTRIBUTE_DECL
public static final java.lang.String ERR_UNDEFINED_ATTRIBUTE_DECL
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_ATTRIBUTE_GROUP
public static final java.lang.String ERR_UNDEFINED_ATTRIBUTE_GROUP
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_COMPLEX_TYPE
public static final java.lang.String ERR_UNDEFINED_COMPLEX_TYPE
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_SIMPLE_TYPE
public static final java.lang.String ERR_UNDEFINED_SIMPLE_TYPE
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_COMPLEX_OR_SIMPLE_TYPE
public static final java.lang.String ERR_UNDEFINED_COMPLEX_OR_SIMPLE_TYPE
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_ELEMENT_DECL
public static final java.lang.String ERR_UNDEFINED_ELEMENT_DECL
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_GROUP
public static final java.lang.String ERR_UNDEFINED_GROUP
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_SCHEMA
public static final java.lang.String ERR_UNDEFINED_SCHEMA
- See Also:
- Constant Field Values
-
WRN_UNSUPPORTED_ANYELEMENT
public static final java.lang.String WRN_UNSUPPORTED_ANYELEMENT
- See Also:
- Constant Field Values
-
WRN_OBSOLETED_NAMESPACE
public static final java.lang.String WRN_OBSOLETED_NAMESPACE
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_OR_FORWARD_REFERENCED_TYPE
public static final java.lang.String ERR_UNDEFINED_OR_FORWARD_REFERENCED_TYPE
- See Also:
- Constant Field Values
-
ERR_REDEFINE_UNDEFINED
public static final java.lang.String ERR_REDEFINE_UNDEFINED
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_ATTRIBUTE_DEFINITION
public static final java.lang.String ERR_DUPLICATE_ATTRIBUTE_DEFINITION
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_COMPLEXTYPE_DEFINITION
public static final java.lang.String ERR_DUPLICATE_COMPLEXTYPE_DEFINITION
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_ATTRIBUTE_GROUP_DEFINITION
public static final java.lang.String ERR_DUPLICATE_ATTRIBUTE_GROUP_DEFINITION
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_GROUP_DEFINITION
public static final java.lang.String ERR_DUPLICATE_GROUP_DEFINITION
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_ELEMENT_DEFINITION
public static final java.lang.String ERR_DUPLICATE_ELEMENT_DEFINITION
- See Also:
- Constant Field Values
-
ERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITION
public static final java.lang.String ERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITION
- See Also:
- Constant Field Values
-
ERR_BAD_XPATH
public static final java.lang.String ERR_BAD_XPATH
- See Also:
- Constant Field Values
-
ERR_UNDEFINED_KEY
public static final java.lang.String ERR_UNDEFINED_KEY
- See Also:
- Constant Field Values
-
ERR_INVALID_BASETYPE_FOR_SIMPLECONTENT
public static final java.lang.String ERR_INVALID_BASETYPE_FOR_SIMPLECONTENT
- See Also:
- Constant Field Values
-
ERR_KEY_FIELD_NUMBER_MISMATCH
public static final java.lang.String ERR_KEY_FIELD_NUMBER_MISMATCH
- See Also:
- Constant Field Values
-
ERR_KEYREF_REFERRING_NON_KEY
public static final java.lang.String ERR_KEYREF_REFERRING_NON_KEY
- See Also:
- Constant Field Values
-
ERR_UNRELATED_TYPES_IN_SUBSTITUTIONGROUP
public static final java.lang.String ERR_UNRELATED_TYPES_IN_SUBSTITUTIONGROUP
- See Also:
- Constant Field Values
-
ERR_RECURSIVE_SUBSTITUTION_GROUP
public static final java.lang.String ERR_RECURSIVE_SUBSTITUTION_GROUP
- See Also:
- Constant Field Values
-
WRN_IMPLICIT_URTYPE_FOR_ELEMENT
public static final java.lang.String WRN_IMPLICIT_URTYPE_FOR_ELEMENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLSchemaReader
public XMLSchemaReader(GrammarReaderController controller)
easy-to-use constructor.
-
XMLSchemaReader
public XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory)
-
XMLSchemaReader
public XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, ExpressionPool pool)
-
XMLSchemaReader
public XMLSchemaReader(GrammarReaderController controller, javax.xml.parsers.SAXParserFactory parserFactory, XMLSchemaReader.StateFactory stateFactory, ExpressionPool pool)
-
-
Method Detail
-
parse
public static XMLSchemaGrammar parse(java.lang.String grammarURL, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)
loads XML Schema
-
parse
public static XMLSchemaGrammar parse(org.xml.sax.InputSource grammar, javax.xml.parsers.SAXParserFactory factory, GrammarReaderController controller)
loads XML Schema
-
parse
public static XMLSchemaGrammar parse(javax.xml.transform.Source schema, GrammarReaderController controller) throws javax.xml.transform.TransformerConfigurationException, javax.xml.transform.TransformerException
Convenience method to create a reader and read a single scheme.- Parameters:
schema-controller-- Returns:
- Throws:
javax.xml.transform.TransformerConfigurationExceptionjavax.xml.transform.TransformerException
-
getXmlSchemaForXmlSchema
public static org.iso_relax.verifier.Schema getXmlSchemaForXmlSchema()
-
getResult
public final XMLSchemaGrammar getResult()
-
getResultAsGrammar
public Grammar getResultAsGrammar()
Description copied from class:GrammarReadergets 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:
getResultAsGrammarin classGrammarReader
-
getOrCreateSchema
public XMLSchemaSchema getOrCreateSchema(java.lang.String namespaceURI)
gets a reference to XMLSchemaGrammar object whose target namespace is the specified one. If there is no such object, this method creates a new instance and returns it.
-
createExpressionChildState
public State createExpressionChildState(State parent, StartTagInfo tag)
Description copied from class:GrammarReaderthis method must be implemented by the derived class to create language-default expresion state.- Specified by:
createExpressionChildStatein classGrammarReader- Returns:
- null if the start tag is an error.
-
createModelGroupState
public State createModelGroupState(State parent, StartTagInfo tag)
creates a state object that parses "all"/"group ref"/"choice" and "sequence".
-
createAttributeState
public State createAttributeState(State parent, StartTagInfo tag)
creates a state object that parses "attribute","attributeGroup ref", and "anyAttribute".
-
createFacetState
public State createFacetState(State parent, StartTagInfo tag)
-
isGrammarElement
protected boolean isGrammarElement(StartTagInfo tag)
Description copied from class:GrammarReaderchecks if given element is that of the grammar elements.- Specified by:
isGrammarElementin classGrammarReader
-
markSchemaAsDefined
public final void markSchemaAsDefined(XMLSchemaSchema schema)
-
isSchemaDefined
public final boolean isSchemaDefined(XMLSchemaSchema schema)
-
resolveNamespaceOfAttributeDecl
protected java.lang.String resolveNamespaceOfAttributeDecl(java.lang.String formValue)
-
resolveNamespaceOfElementDecl
protected java.lang.String resolveNamespaceOfElementDecl(java.lang.String formValue)
-
resolveNamespaceOfDeclaration
private java.lang.String resolveNamespaceOfDeclaration(java.lang.String formValue, java.lang.String defaultValue)
-
resolveBuiltinDataType
public XSDatatype resolveBuiltinDataType(java.lang.String typeLocalName)
resolves built-in datatypes (URI: http://www.w3.org/2001/XMLSchema)- Returns:
- null if the type is not defined.
-
resolveBuiltinSimpleType
public SimpleTypeExp resolveBuiltinSimpleType(java.lang.String typeLocalName)
Gets a built-in datatype as SimpleTypeExp.- Returns:
- null if the type is not defined.
-
isSchemaNamespace
public boolean isSchemaNamespace(java.lang.String ns)
-
resolveXSDatatype
public XSDatatypeExp resolveXSDatatype(java.lang.String typeQName)
Resolves a simple type name into the corresponding XSDatatypeExp object.- Specified by:
resolveXSDatatypein interfaceXSDatatypeResolver- Parameters:
typeQName- 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.
-
resolveQNameRef
public Expression resolveQNameRef(StartTagInfo tag, java.lang.String attName, XMLSchemaReader.RefResolver resolver)
-
splitQName
public java.lang.String[] splitQName(java.lang.String qName)
Resolves a QName into a pair of (namespace URI,local name).When we are parsing a "chameleon schema", any reference to the default empty namespace("") has to be treated as a reference to the intended target namespace.
- Overrides:
splitQNamein classGrammarReader
-
interceptExpression
protected Expression interceptExpression(State state, Expression exp)
Description copied from class:GrammarReaderintercepts an expression made by ExpressionState before it is passed to the parent state. derived class can perform further wrap-up before it is received by the parent. This mechanism is used by RELAXReader to handle occurs attribute.- Overrides:
interceptExpressionin classGrammarReader
-
processOccurs
public Expression processOccurs(StartTagInfo startTag, Expression item)
Adds maxOccurs/minOccurs semantics to a given expression. For example, if this method receives A, minOccurs=0, and maxOccurs=3, then this method should return something like (A,(A,A?)?)?
-
processOccurs
public Expression processOccurs(Expression item, int minOccurs, int maxOccurs)
Adds maxOccurs/minOccurs semantics to a given expression.- Parameters:
maxOccurs- -1 to represent "unbounded".
-
_processOccurs
private Expression _processOccurs(Expression item, int minOccurs, int maxOccurs)
-
switchSource
protected void switchSource(State sourceState, State newRootState) throws AbortException
- Throws:
AbortException
-
wrapUp
protected void wrapUp()
performs final wrap-up of parsing. this method is called by RootState after the parsing of the entire documents has completed.
-
getType
private XMLSchemaReader.Type getType(XMLSchemaTypeExp exp)
-
getType
private XMLSchemaReader.Type getType(XSDatatype dt)
-
isSubstitutable
private boolean isSubstitutable(ElementDeclExp c, ElementDeclExp d)
implementation of "SCC: Substitution Group OK (Transitive)".- Parameters:
c- the substitution headd- a member of the substitution group of c.- Returns:
- true if d can validly substitute c.
-
localizeMessage
protected java.lang.String localizeMessage(java.lang.String propertyName, java.lang.Object[] args)Description copied from class:GrammarReaderformats localized message with arguments- Specified by:
localizeMessagein classGrammarReader
-
getAdditionalNamespaceMap
public java.util.Map<java.lang.String,java.lang.String> getAdditionalNamespaceMap()
-
setAdditionalNamespaceMap
public void setAdditionalNamespaceMap(java.util.Map<java.lang.String,java.lang.String> additionalNamespaceMap)
-
-