public class XmlSchema extends XmlSchemaAnnotated implements NamespaceContextOwner
| Modifier and Type | Field and Description |
|---|---|
private XmlSchemaForm |
attributeFormDefault |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaAttributeGroup> |
attributeGroups |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaAttribute> |
attributes |
private XmlSchemaDerivationMethod |
blockDefault |
private XmlSchemaForm |
elementFormDefault |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaElement> |
elements |
private java.util.List<XmlSchemaExternal> |
externals |
private XmlSchemaDerivationMethod |
finalDefault |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaGroup> |
groups |
private java.lang.String |
inputEncoding |
private java.util.List<XmlSchemaObject> |
items |
private java.lang.String |
logicalTargetNamespace |
private NamespacePrefixList |
namespaceContext |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaNotation> |
notations |
private XmlSchemaCollection |
parent |
(package private) static java.lang.String |
SCHEMA_NS |
private java.lang.String |
schemaNamespacePrefix |
private java.util.Map<javax.xml.namespace.QName,XmlSchemaType> |
schemaTypes |
private java.lang.String |
syntacticalTargetNamespace |
private static java.lang.String |
UTF_8_ENCODING |
private java.lang.String |
version |
lineNumber, linePosition, sourceURI| Constructor and Description |
|---|
XmlSchema()
Create a schema that is not a member of a collection and has no target namespace or system ID.
|
XmlSchema(java.lang.String namespace,
java.lang.String systemId,
XmlSchemaCollection parent)
Create a new schema with a target namespace and system ID, and record it as a member of a schema
collection.
|
XmlSchema(java.lang.String namespace,
XmlSchemaCollection parent)
Create a new schema in a collection with a target namespace.
|
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Document[] |
getAllSchemas()
Return an array of DOM documents consisting of this schema and any schemas that it references.
|
XmlSchemaAttribute |
getAttributeByName(javax.xml.namespace.QName name)
Retrieve a global attribute by its QName.
|
protected XmlSchemaAttribute |
getAttributeByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack) |
XmlSchemaAttribute |
getAttributeByName(java.lang.String name)
Look for an attribute by its local name.
|
XmlSchemaForm |
getAttributeFormDefault() |
XmlSchemaAttributeGroup |
getAttributeGroupByName(javax.xml.namespace.QName name)
Retrieve an attribute group by QName.
|
protected XmlSchemaAttributeGroup |
getAttributeGroupByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack) |
java.util.Map<javax.xml.namespace.QName,XmlSchemaAttributeGroup> |
getAttributeGroups()
Return a map containing all the defined attribute groups of this schema.
|
java.util.Map<javax.xml.namespace.QName,XmlSchemaAttribute> |
getAttributes()
Return a map containing all the defined attributes of this schema.
|
XmlSchemaDerivationMethod |
getBlockDefault()
Return the default block value for this schema.
|
XmlSchemaElement |
getElementByName(javax.xml.namespace.QName name)
Look for a element by its QName.
|
protected XmlSchemaElement |
getElementByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack) |
XmlSchemaElement |
getElementByName(java.lang.String name)
get an element by its local name.
|
XmlSchemaForm |
getElementFormDefault() |
java.util.Map<javax.xml.namespace.QName,XmlSchemaElement> |
getElements()
Return a map containing all the defined elements of this schema.
|
java.util.List<XmlSchemaExternal> |
getExternals()
Return all of the includes, imports, and redefines for this schema.
|
XmlSchemaDerivationMethod |
getFinalDefault() |
XmlSchemaGroup |
getGroupByName(javax.xml.namespace.QName name)
Retrieve a group by QName.
|
protected XmlSchemaGroup |
getGroupByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack) |
java.util.Map<javax.xml.namespace.QName,XmlSchemaGroup> |
getGroups()
Return a map containing all the defined groups of this schema.
|
java.lang.String |
getInputEncoding()
Return the character encoding for this schema.
|
java.util.List<XmlSchemaObject> |
getItems()
Return all of the global items in this schema.
If org.apache.ws.commons.schema.protectReadOnlyCollections is 'true', this will return a map that checks at runtime. |
java.lang.String |
getLogicalTargetNamespace()
Return the logical target namespace.
|
NamespacePrefixList |
getNamespaceContext()
Returns the objects namespace context.
|
XmlSchemaNotation |
getNotationByName(javax.xml.namespace.QName name)
Retrieve a notation by QName.
|
protected XmlSchemaNotation |
getNotationByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack) |
java.util.Map<javax.xml.namespace.QName,XmlSchemaNotation> |
getNotations()
Return a map containing all the defined notations of this schema.
|
XmlSchemaCollection |
getParent()
Return the parent XmlSchemaCollection.
|
private XmlSchema |
getSchema(java.lang.Object includeOrImport)
Get a schema from an import
|
org.w3c.dom.Document |
getSchemaDocument()
Retrieve a DOM tree for this one schema, independent of any included or related schemas.
|
java.lang.String |
getSchemaNamespacePrefix() |
java.util.Map<javax.xml.namespace.QName,XmlSchemaType> |
getSchemaTypes()
Return a map containing all the defined types of this schema.
|
(package private) java.lang.String |
getSyntacticalTargetNamespace() |
java.lang.String |
getTargetNamespace()
Return the declared target namespace of this schema.
|
XmlSchemaType |
getTypeByName(javax.xml.namespace.QName name)
Search this schema, and its peers in its parent collection, for a schema type specified by QName.
|
protected XmlSchemaType |
getTypeByName(javax.xml.namespace.QName name,
boolean deep,
java.util.Stack<XmlSchema> schemaStack)
Protected method that allows safe (non-recursive schema loading).
|
XmlSchemaType |
getTypeByName(java.lang.String name)
Retrieve a named type from this schema.
|
java.lang.String |
getVersion()
Return the declared XML Schema version of this schema.
|
private void |
loadDefaultOptions(java.util.Map<java.lang.String,java.lang.String> options)
Load the default options
|
private void |
serializeInternal(java.io.Writer out,
java.util.Map<java.lang.String,java.lang.String> options)
serialize the schema - this is the method tht does to work
|
void |
setAttributeFormDefault(XmlSchemaForm value)
Set the default attribute form for this schema.
|
void |
setBlockDefault(XmlSchemaDerivationMethod blockDefault)
Set the default block value for this schema.
|
void |
setElementFormDefault(XmlSchemaForm elementFormDefault)
Set the default element form for this schema.
|
void |
setFinalDefault(XmlSchemaDerivationMethod finalDefault)
Set the default 'final' value for this schema.
|
void |
setInputEncoding(java.lang.String encoding)
Set the character encoding name for the schema.
|
(package private) void |
setLogicalTargetNamespace(java.lang.String logicalTargetNamespace) |
void |
setNamespaceContext(NamespacePrefixList namespaceContext)
Sets the schema elements namespace context.
|
(package private) void |
setParent(XmlSchemaCollection parent) |
void |
setSchemaNamespacePrefix(java.lang.String schemaNamespacePrefix)
Set the namespace prefix corresponding to the target namespace.
|
(package private) void |
setSyntacticalTargetNamespace(java.lang.String syntacticalTargetNamespace) |
void |
setTargetNamespace(java.lang.String targetNamespace)
Set the target namespace for this schema.
|
(package private) void |
setVersion(java.lang.String version) |
java.lang.String |
toString() |
void |
write(java.io.OutputStream out)
Serialize the schema as XML to the specified stream using the encoding established with
setInputEncoding(String). |
void |
write(java.io.OutputStream out,
java.util.Map<java.lang.String,java.lang.String> options)
Serialize the schema as XML to the specified stream using the encoding established with
setInputEncoding(String). |
void |
write(java.io.Writer writer)
Serialize the schema to a
Writer. |
void |
write(java.io.Writer writer,
java.util.Map<java.lang.String,java.lang.String> options)
Serialize the schema to a
Writer. |
getAnnotation, getId, getUnhandledAttributes, setAnnotation, setId, setUnhandledAttributesaddMetaInfo, equals, getLineNumber, getLinePosition, getMetaInfoMap, getSourceURI, hashCode, setLineNumber, setLinePosition, setMetaInfoMap, setSourceURIstatic final java.lang.String SCHEMA_NS
private static final java.lang.String UTF_8_ENCODING
private java.util.List<XmlSchemaObject> items
private XmlSchemaCollection parent
private XmlSchemaDerivationMethod blockDefault
private XmlSchemaDerivationMethod finalDefault
private XmlSchemaForm elementFormDefault
private XmlSchemaForm attributeFormDefault
private java.util.List<XmlSchemaExternal> externals
private java.util.Map<javax.xml.namespace.QName,XmlSchemaAttributeGroup> attributeGroups
private java.util.Map<javax.xml.namespace.QName,XmlSchemaAttribute> attributes
private java.util.Map<javax.xml.namespace.QName,XmlSchemaElement> elements
private java.util.Map<javax.xml.namespace.QName,XmlSchemaGroup> groups
private java.util.Map<javax.xml.namespace.QName,XmlSchemaNotation> notations
private java.util.Map<javax.xml.namespace.QName,XmlSchemaType> schemaTypes
private java.lang.String syntacticalTargetNamespace
private java.lang.String schemaNamespacePrefix
private java.lang.String logicalTargetNamespace
private java.lang.String version
private NamespacePrefixList namespaceContext
private java.lang.String inputEncoding
public XmlSchema()
public XmlSchema(java.lang.String namespace,
java.lang.String systemId,
XmlSchemaCollection parent)
namespace - the target namespace.systemId - the system ID for the schema. This is used to resolve references to other schemas.parent - the parent collection.public XmlSchema(java.lang.String namespace,
XmlSchemaCollection parent)
namespace - the target namespace.parent - the containing collection.public org.w3c.dom.Document[] getAllSchemas()
XmlSchemaExternal objects corresponding to them
have their 'schema' fields filled in.public XmlSchemaAttribute getAttributeByName(javax.xml.namespace.QName name)
name - public XmlSchemaAttribute getAttributeByName(java.lang.String name)
name - public XmlSchemaForm getAttributeFormDefault()
public XmlSchemaAttributeGroup getAttributeGroupByName(javax.xml.namespace.QName name)
name - public java.util.Map<javax.xml.namespace.QName,XmlSchemaAttributeGroup> getAttributeGroups()
public java.util.Map<javax.xml.namespace.QName,XmlSchemaAttribute> getAttributes()
public XmlSchemaDerivationMethod getBlockDefault()
public XmlSchemaElement getElementByName(javax.xml.namespace.QName name)
name - public XmlSchemaElement getElementByName(java.lang.String name)
name - public XmlSchemaForm getElementFormDefault()
public java.util.Map<javax.xml.namespace.QName,XmlSchemaElement> getElements()
public java.util.List<XmlSchemaExternal> getExternals()
public XmlSchemaDerivationMethod getFinalDefault()
public XmlSchemaGroup getGroupByName(javax.xml.namespace.QName name)
name - public java.util.Map<javax.xml.namespace.QName,XmlSchemaGroup> getGroups()
public java.lang.String getInputEncoding()
setInputEncoding(String).public java.util.List<XmlSchemaObject> getItems()
public java.lang.String getLogicalTargetNamespace()
public NamespacePrefixList getNamespaceContext()
getNamespaceContext in interface NamespaceContextOwnerpublic XmlSchemaNotation getNotationByName(javax.xml.namespace.QName name)
name - public java.util.Map<javax.xml.namespace.QName,XmlSchemaNotation> getNotations()
public XmlSchemaCollection getParent()
public org.w3c.dom.Document getSchemaDocument()
throws XmlSchemaSerializer.XmlSchemaSerializerException
XmlSchemaSerializer.XmlSchemaSerializerExceptionpublic java.lang.String getSchemaNamespacePrefix()
public java.util.Map<javax.xml.namespace.QName,XmlSchemaType> getSchemaTypes()
public java.lang.String getTargetNamespace()
getLogicalTargetNamespace()public XmlSchemaType getTypeByName(javax.xml.namespace.QName name)
name - the type name.public XmlSchemaType getTypeByName(java.lang.String name)
name - public java.lang.String getVersion()
public void setAttributeFormDefault(XmlSchemaForm value)
value - the form. This may not be null.public void setBlockDefault(XmlSchemaDerivationMethod blockDefault)
blockDefault - the new block value.public void setElementFormDefault(XmlSchemaForm elementFormDefault)
elementFormDefault - the element form. This may not be null.public void setFinalDefault(XmlSchemaDerivationMethod finalDefault)
finalDefault - the new final value.public void setInputEncoding(java.lang.String encoding)
encoding - Character encoding name.public void setNamespaceContext(NamespacePrefixList namespaceContext)
public void setSchemaNamespacePrefix(java.lang.String schemaNamespacePrefix)
schemaNamespacePrefix - public void setTargetNamespace(java.lang.String targetNamespace)
targetNamespace - the new target namespace URI. A value of "" is ignored.public java.lang.String toString()
toString in class XmlSchemaAnnotatedpublic void write(java.io.OutputStream out)
throws java.io.UnsupportedEncodingException
setInputEncoding(String).out - - the output stream to write tojava.io.UnsupportedEncodingException - for an invalid encoding.public void write(java.io.OutputStream out,
java.util.Map<java.lang.String,java.lang.String> options)
throws java.io.UnsupportedEncodingException
setInputEncoding(String).out - - the output stream to write tooptions - - a map of optionsjava.io.UnsupportedEncodingExceptionpublic void write(java.io.Writer writer)
Writer.writer - - the writer to write thispublic void write(java.io.Writer writer,
java.util.Map<java.lang.String,java.lang.String> options)
Writer.writer - - the writer to write thisprotected XmlSchemaAttribute getAttributeByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
protected XmlSchemaAttributeGroup getAttributeGroupByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
protected XmlSchemaElement getElementByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
protected XmlSchemaGroup getGroupByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
protected XmlSchemaNotation getNotationByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
protected XmlSchemaType getTypeByName(javax.xml.namespace.QName name, boolean deep, java.util.Stack<XmlSchema> schemaStack)
name - deep - schemaStack - java.lang.String getSyntacticalTargetNamespace()
void setLogicalTargetNamespace(java.lang.String logicalTargetNamespace)
void setParent(XmlSchemaCollection parent)
void setSyntacticalTargetNamespace(java.lang.String syntacticalTargetNamespace)
void setVersion(java.lang.String version)
private XmlSchema getSchema(java.lang.Object includeOrImport)
includeOrImport - private void loadDefaultOptions(java.util.Map<java.lang.String,java.lang.String> options)
options - - the map ofprivate void serializeInternal(java.io.Writer out,
java.util.Map<java.lang.String,java.lang.String> options)
out - options -