deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.framework.xml.schema
Class XSDocument

java.lang.Object
  extended by org.deegree.framework.xml.XMLFragment
      extended by org.deegree.framework.xml.schema.XSDocument
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GMLSchemaDocument

public class XSDocument
extends XMLFragment

Parser for XML schema documents.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Markus Schneider , Anup Deshmukh , last edited by: $Author: mschneider $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.framework.xml.XMLFragment
DEFAULT_URL, nsContext, XLNNS
 
Constructor Summary
XSDocument()
           
 
Method Summary
 ComplexTypeDeclaration[] extractComplexTypeDeclarations()
          Extracts all global (top-level) complex type declarations from the underlying schema document.
 ElementDeclaration[] extractElementDeclarations()
          Extracts all global (top-level) element declarations from the underlying schema document.
 SimpleTypeDeclaration[] extractSimpleTypeDeclarations()
          Extracts all global (top-level) simple type declarations from the underlying schema document.
 org.w3c.dom.Element getComplexTypeDeclaration(java.lang.String name)
          Returns the root element of the complex type declaration for the given name.
protected  java.lang.String getFullName(java.lang.String localName)
          Prepends the prefix of the RootElement to the given local name.
 java.net.URI getTargetNamespace()
          Returns the target namespace of the underlying schema document.
protected  ComplexTypeDeclaration parseComplexTypeDeclaration(org.w3c.dom.Element element)
          Parses the given Element as an 'xs:complexType' declaration.
protected  ElementDeclaration parseElementDeclaration(org.w3c.dom.Element element)
          Parses the given Element as an 'xs:element' declaration.
protected  SimpleTypeDeclaration parseSimpleTypeDeclaration(org.w3c.dom.Element element)
          Parses the given Element as an 'xs:simpleType' declaration.
 XMLSchema parseXMLSchema()
          Returns the class representation of the underlying schema document.
 
Methods inherited from class org.deegree.framework.xml.XMLFragment
getAsPrettyString, getAsString, getAttachedSchemas, getQualifiedName, getRootElement, getSystemId, hasSchema, load, load, load, parseQualifiedName, parseSimpleLink, prettyPrint, prettyPrint, resolve, setRootElement, setSystemId, setSystemId, toString, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSDocument

public XSDocument()
Method Detail

parseXMLSchema

public XMLSchema parseXMLSchema()
                         throws XMLParsingException,
                                XMLSchemaException
Returns the class representation of the underlying schema document.

Returns:
class representation of the underlying schema document
Throws:
XMLParsingException
XMLSchemaException

getTargetNamespace

public java.net.URI getTargetNamespace()
                                throws XMLParsingException
Returns the target namespace of the underlying schema document.

Returns:
target namespace of the underlying schema document
Throws:
XMLParsingException

extractSimpleTypeDeclarations

public SimpleTypeDeclaration[] extractSimpleTypeDeclarations()
                                                      throws XMLParsingException
Extracts all global (top-level) simple type declarations from the underlying schema document.

Returns:
all global (top-level) simple type declarations
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

extractComplexTypeDeclarations

public ComplexTypeDeclaration[] extractComplexTypeDeclarations()
                                                        throws XMLParsingException
Extracts all global (top-level) complex type declarations from the underlying schema document.

Returns:
all global (top-level) complex type declarations
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

extractElementDeclarations

public ElementDeclaration[] extractElementDeclarations()
                                                throws XMLParsingException
Extracts all global (top-level) element declarations from the underlying schema document.

Returns:
all global (top-level) element declarations
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

getComplexTypeDeclaration

public org.w3c.dom.Element getComplexTypeDeclaration(java.lang.String name)
Returns the root element of the complex type declaration for the given name.

Parameters:
name - the name of the complex type declaration to look up (w/o namespace)
Returns:
the root element of the complex type declaration or null, if the requested complex type is not declared

parseElementDeclaration

protected ElementDeclaration parseElementDeclaration(org.w3c.dom.Element element)
                                              throws XMLParsingException
Parses the given Element as an 'xs:element' declaration.

Parameters:
element - 'xs:element' declaration to be parsed
Returns:
object representation of the declaration
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

parseSimpleTypeDeclaration

protected SimpleTypeDeclaration parseSimpleTypeDeclaration(org.w3c.dom.Element element)
                                                    throws XMLParsingException
Parses the given Element as an 'xs:simpleType' declaration.

The following limitations apply:

Parameters:
element - 'xs:simpleType' declaration to be parsed
Returns:
object representation of the declaration
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

parseComplexTypeDeclaration

protected ComplexTypeDeclaration parseComplexTypeDeclaration(org.w3c.dom.Element element)
                                                      throws XMLParsingException
Parses the given Element as an 'xs:complexType' declaration.

Parameters:
element - 'xs:complexType' declaration to be parsed
Returns:
object representation of the declaration
Throws:
XMLParsingException - if the document is not a valid XML Schema document or does not match the limitations of this class

getFullName

protected java.lang.String getFullName(java.lang.String localName)
Prepends the prefix of the RootElement to the given local name.

If the prefix of the RootElement is empty, "xs:" is prepended.

Parameters:
localName - to this the prefix will be prepended
Returns:
prefix + localName

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org