com.sun.msv.reader.xmlschema
Class XMLSchemaReader
public
class
XMLSchemaReader
extends GrammarReader
implements XSDatatypeResolver
parses XML representation of XML Schema and constructs AGM.
Author: Kohsuke KAWAGUCHI
Method Summary |
State | createAttributeState(State parent, StartTagInfo tag)
creates a state object that parses "attribute","attributeGroup ref", and "anyAttribute". |
State | createExpressionChildState(State parent, StartTagInfo tag) |
State | createFacetState(State parent, StartTagInfo tag) |
State | createModelGroupState(State parent, StartTagInfo tag)
creates a state object that parses "all"/"group ref"/"choice" and "sequence". |
XMLSchemaSchema | getOrCreateSchema(String namespaceURI)
gets a reference to XMLSchemaGrammar object whose target namespace
is the specified one.
|
XMLSchemaGrammar | getResult() |
Grammar | getResultAsGrammar() |
static Schema | getXmlSchemaForXmlSchema() |
boolean | isSchemaDefined(XMLSchemaSchema schema) |
boolean | isSchemaNamespace(String ns) |
void | markSchemaAsDefined(XMLSchemaSchema schema) |
static XMLSchemaGrammar | parse(String grammarURL, SAXParserFactory factory, GrammarReaderController controller) loads XML Schema |
static XMLSchemaGrammar | parse(InputSource grammar, SAXParserFactory factory, GrammarReaderController controller) loads XML Schema |
Expression | processOccurs(StartTagInfo startTag, Expression item)
Adds maxOccurs/minOccurs semantics to a given expression.
|
Expression | processOccurs(Expression item, int minOccurs, int maxOccurs)
Adds maxOccurs/minOccurs semantics to a given expression.
|
XSDatatype | resolveBuiltinDataType(String typeLocalName)
resolves built-in datatypes (URI: http://www.w3.org/2001/XMLSchema)
|
SimpleTypeExp | resolveBuiltinSimpleType(String typeLocalName)
Gets a built-in datatype as SimpleTypeExp.
|
Expression | resolveQNameRef(StartTagInfo tag, String attName, XMLSchemaReader.RefResolver resolver) |
XSDatatypeExp | resolveXSDatatype(String typeQName)
Resolves a simple type name into the corresponding XSDatatypeExp object. |
String[] | splitQName(String qName)
Resolves a QName into a pair of (namespace URI,local name).
|
expression that matches to "ur-type" when used as a complex type.
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.
public static final String ERR_BAD_XPATH
public static final String ERR_DUPLICATE_ATTRIBUTE_DEFINITION
public static final String ERR_DUPLICATE_ATTRIBUTE_GROUP_DEFINITION
public static final String ERR_DUPLICATE_COMPLEXTYPE_DEFINITION
public static final String ERR_DUPLICATE_ELEMENT_DEFINITION
public static final String ERR_DUPLICATE_GROUP_DEFINITION
public static final String ERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITION
public static final String ERR_DUPLICATE_SCHEMA_DEFINITION
public static final String ERR_IMPORTING_SAME_NAMESPACE
public static final String ERR_INCONSISTENT_TARGETNAMESPACE
public static final String ERR_INVALID_BASETYPE_FOR_SIMPLECONTENT
public static final String ERR_KEYREF_REFERRING_NON_KEY
public static final String ERR_KEY_FIELD_NUMBER_MISMATCH
public static final String ERR_MAXOCCURS_IS_NECESSARY
public static final String ERR_RECURSIVE_SUBSTITUTION_GROUP
public static final String ERR_REDEFINE_UNDEFINED
public static final String ERR_UNDECLARED_PREFIX
public static final String ERR_UNDEFINED_ATTRIBUTE_DECL
public static final String ERR_UNDEFINED_ATTRIBUTE_GROUP
public static final String ERR_UNDEFINED_COMPLEX_OR_SIMPLE_TYPE
public static final String ERR_UNDEFINED_COMPLEX_TYPE
public static final String ERR_UNDEFINED_ELEMENTTYPE
public static final String ERR_UNDEFINED_ELEMENT_DECL
public static final String ERR_UNDEFINED_GROUP
public static final String ERR_UNDEFINED_KEY
public static final String ERR_UNDEFINED_OR_FORWARD_REFERENCED_TYPE
public static final String ERR_UNDEFINED_SCHEMA
public static final String ERR_UNDEFINED_SIMPLE_TYPE
public static final String ERR_UNIMPLEMENTED_FEATURE
public static final String ERR_UNRELATED_TYPES_IN_SUBSTITUTIONGROUP
public final Map 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).
public static final String WRN_IMPLICIT_URTYPE_FOR_ELEMENT
public static final String WRN_OBSOLETED_NAMESPACE
public static final String WRN_UNSUPPORTED_ANYELEMENT
content model that matches to
optional xsi:schemaLocation or xsi:noNamespaceSchemaLocation.
public static final String XMLSchemaNamespace
namespace URI of XML Schema declarations.
public static final String XMLSchemaNamespace_old
public static final String XMLSchemaSchemaLocationAttributes
easy-to-use constructor.
creates a state object that parses "attribute","attributeGroup ref", and "anyAttribute".
creates a state object that parses "all"/"group ref"/"choice" and "sequence".
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.
public
Grammar getResultAsGrammar()
public static Schema getXmlSchemaForXmlSchema()
public boolean isSchemaNamespace(String ns)
loads XML Schema
loads XML Schema
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?)?)?
Adds maxOccurs/minOccurs semantics to a given expression.
Parameters: maxOccurs
-1 to represent "unbounded".
public XSDatatype resolveBuiltinDataType(String typeLocalName)
resolves built-in datatypes (URI: http://www.w3.org/2001/XMLSchema)
Returns:
null if the type is not defined.
public
SimpleTypeExp resolveBuiltinSimpleType(String typeLocalName)
Gets a built-in datatype as SimpleTypeExp.
Returns:
null if the type is not defined.
Resolves a simple type name into the corresponding XSDatatypeExp object.
public String[] splitQName(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.