org.apache.ws.jaxme.xs.xml.impl

Class XsESchemaImpl

Implemented Interfaces:
XsESchema, XsObject, XsSchemaHeader, XsTOpenAttrs
Known Direct Subclasses:
JAXBXsSchemaImpl

public class XsESchemaImpl
extends XsTOpenAttrsImpl
implements XsESchema

Implementation of xs:schema. Follows this specification:
  <xs:element name="schema" id="schema">
    <xs:annotation>
      <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xs:openAttrs">
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="xs:include"/>
              <xs:element ref="xs:import"/>
              <xs:element ref="xs:redefine"/>
              <xs:element ref="xs:annotation"/>
            </xs:choice>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
              <xs:group ref="xs:schemaTop"/>
              <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:sequence>
          <xs:attribute name="targetNamespace" type="xs:anyURI"/>
          <xs:attribute name="version" type="xs:token"/>
          <xs:attribute name="finalDefault" type="xs:derivationSet" use="optional" default=""/>
          <xs:attribute name="blockDefault" type="xs:blockSet" use="optional" default=""/>
          <xs:attribute name="attributeFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
          <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
          <xs:attribute name="id" type="xs:ID"/>
          <xs:attribute ref="xml:lang"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>

    <xs:key name="element">
      <xs:selector xpath="xs:element"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="attribute">
      <xs:selector xpath="xs:attribute"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="type">
      <xs:selector xpath="xs:complexType|xs:simpleType"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="group">
      <xs:selector xpath="xs:group"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="attributeGroup">
      <xs:selector xpath="xs:attributeGroup"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="notation">
      <xs:selector xpath="xs:notation"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:key name="identityConstraint">
      <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
      <xs:field xpath="@name"/>
    </xs:key>
  </xs:element>

  <xs:group name="schemaTop">
    <xs:annotation>
      <xs:documentation>
        This group is for the
        elements which occur freely at the top level of schemas.
        All of their types are based on the "annotated" type by extension.
      </xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:group ref="xs:redefinable"/>
      <xs:element ref="xs:element"/>
      <xs:element ref="xs:attribute"/>
      <xs:element ref="xs:notation"/>
    </xs:choice>
  </xs:group>
 
Author:
Jochen Wiedmann

Constructor Summary

XsESchemaImpl(XSContext pContext)

Method Summary

XsEAnnotation
createAnnotation()
XsTAttribute
createAttribute()
XsTAttributeGroup
createAttributeGroup()
XsTComplexType
createComplexType()
XsTTopLevelElement
createElement()
XsTNamedGroup
createGroup()
XsEImport
createImport()
XsEInclude
createInclude()
XsENotation
createNotation()
XsERedefine
createRedefine()
XsETopLevelSimpleType
createSimpleType()
XsFormChoice
getAttributeFormDefault()
XsBlockSet
getBlockDefault()
Object[]
getChilds()
XSContext
getContext()
XsFormChoice
getElementFormDefault()
XsDerivationSet
getFinalDefault()
XsID
getId()
XmlLang
getLang()
XsAnyURI
getTargetNamespace()
String
getTargetNamespacePrefix()
XsToken
getVersion()
XsQName
newXsQName(String pLocalName, String pPrefix)
Creates a new XsQName, which is mutable and has the schemas target namespace as a namespace URI: If the target namespace changes, then the names URI does as well.
boolean
setAttribute(String pQName, String pNamespaceURI, String pLocalName, String pValue)
void
setAttributeFormDefault(XsFormChoice pChoice)
void
setBlockDefault(XsBlockSet pSet)
void
setElementFormDefault(XsFormChoice pChoice)
void
setFinalDefault(XsDerivationSet pSet)
void
setId(XsID pId)
void
setLang(XmlLang pLanguage)
void
setTargetNamespace(XsAnyURI pAnyURI)
void
setVersion(XsToken pToken)

Methods inherited from class org.apache.ws.jaxme.xs.xml.impl.XsTOpenAttrsImpl

getOpenAttributes, setAttribute

Methods inherited from class org.apache.ws.jaxme.xs.xml.impl.XsObjectImpl

asXsQName, asXsQName, getContext, getLocator, getNamespaceSupport, getObjectFactory, getParentObject, getXsESchema, isTopLevelObject, isValidated, validate

Constructor Details

XsESchemaImpl

protected XsESchemaImpl(XSContext pContext)

Method Details

createAnnotation

public XsEAnnotation createAnnotation()
Specified by:
createAnnotation in interface XsESchema

createAttribute

public XsTAttribute createAttribute()
Specified by:
createAttribute in interface XsESchema

createAttributeGroup

public XsTAttributeGroup createAttributeGroup()
Specified by:
createAttributeGroup in interface XsESchema

createComplexType

public XsTComplexType createComplexType()
Specified by:
createComplexType in interface XsESchema

createElement

public XsTTopLevelElement createElement()
Specified by:
createElement in interface XsESchema

createGroup

public XsTNamedGroup createGroup()
Specified by:
createGroup in interface XsESchema

createImport

public XsEImport createImport()
Specified by:
createImport in interface XsESchema

createInclude

public XsEInclude createInclude()
Specified by:
createInclude in interface XsESchema

createNotation

public XsENotation createNotation()
Specified by:
createNotation in interface XsESchema

createRedefine

public XsERedefine createRedefine()
Specified by:
createRedefine in interface XsESchema

createSimpleType

public XsETopLevelSimpleType createSimpleType()
Specified by:
createSimpleType in interface XsESchema

getAttributeFormDefault

public XsFormChoice getAttributeFormDefault()
Specified by:
getAttributeFormDefault in interface XsSchemaHeader

getBlockDefault

public XsBlockSet getBlockDefault()
Specified by:
getBlockDefault in interface XsSchemaHeader

getChilds

public Object[] getChilds()
Specified by:
getChilds in interface XsESchema

getContext

public XSContext getContext()
Specified by:
getContext in interface XsESchema
Overrides:
getContext in interface XsObjectImpl

getElementFormDefault

public XsFormChoice getElementFormDefault()
Specified by:
getElementFormDefault in interface XsSchemaHeader

getFinalDefault

public XsDerivationSet getFinalDefault()
Specified by:
getFinalDefault in interface XsSchemaHeader

getId

public XsID getId()
Specified by:
getId in interface XsSchemaHeader

getLang

public XmlLang getLang()

getTargetNamespace

public XsAnyURI getTargetNamespace()
Specified by:
getTargetNamespace in interface XsSchemaHeader

getTargetNamespacePrefix

public String getTargetNamespacePrefix()
Specified by:
getTargetNamespacePrefix in interface XsSchemaHeader

getVersion

public XsToken getVersion()
Specified by:
getVersion in interface XsSchemaHeader

newXsQName

public XsQName newXsQName(String pLocalName,
                          String pPrefix)
Creates a new XsQName, which is mutable and has the schemas target namespace as a namespace URI: If the target namespace changes, then the names URI does as well.

setAttribute

public boolean setAttribute(String pQName,
                            String pNamespaceURI,
                            String pLocalName,
                            String pValue)
            throws SAXException
Overrides:
setAttribute in interface XsTOpenAttrsImpl

setAttributeFormDefault

public void setAttributeFormDefault(XsFormChoice pChoice)
Specified by:
setAttributeFormDefault in interface XsESchema

setBlockDefault

public void setBlockDefault(XsBlockSet pSet)
Specified by:
setBlockDefault in interface XsESchema

setElementFormDefault

public void setElementFormDefault(XsFormChoice pChoice)
Specified by:
setElementFormDefault in interface XsESchema

setFinalDefault

public void setFinalDefault(XsDerivationSet pSet)
Specified by:
setFinalDefault in interface XsESchema

setId

public void setId(XsID pId)
Specified by:
setId in interface XsESchema

setLang

public void setLang(XmlLang pLanguage)

setTargetNamespace

public void setTargetNamespace(XsAnyURI pAnyURI)
Specified by:
setTargetNamespace in interface XsESchema

setVersion

public void setVersion(XsToken pToken)
Specified by:
setVersion in interface XsESchema