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

org.deegree.io.datastore.schema
Class MappedGMLSchemaDocument

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

public class MappedGMLSchemaDocument
extends GMLSchemaDocument

Parser for GML schema documents which are annotated with mapping (persistence) information.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Markus Schneider , 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
MappedGMLSchemaDocument()
           
 
Method Summary
(package private)  MappedGMLId extractGMLId(org.w3c.dom.Element annotationElement, java.lang.String defaultTableName)
          Extracts the "gml:id" information from the given "xs:annotation" element.
protected  MappedComplexTypeDeclaration parseComplexTypeDeclaration(org.w3c.dom.Element element)
          Parses the given Element as an annotated 'xs:complexType' declaration (with mapping information).
(package private)  ConstantContent parseConstantContent(org.w3c.dom.Element element)
          Parses the given element as a "deegreewfs:Constant" element.
 java.net.URI parseDefaultSRS(org.w3c.dom.Element annotationElement, java.net.URI defaultValue)
          Returns the value of the "deegreewfs:DefaultSRS" element.
protected  MappedElementDeclaration parseElementDeclaration(org.w3c.dom.Element element)
          Parses the given Element as an annotated 'xs:element' declaration (with mapping information).
(package private)  FunctionParam parseFunctionParam(org.w3c.dom.Element element, java.lang.String table)
          Parses the given "deegreewfs:FunctionParam" element.
 java.util.LinkedList<Pair<PropertyType,QualifiedName>> parseGMLDefaultProps(org.w3c.dom.Element annotationElement, java.lang.String table, MappedGMLSchema schema)
           
 int parseIdentityPart(org.w3c.dom.Element annotationElement)
          Returns the value of the "deegreewfs:IdentityPart" element.
 boolean parseIsDeletable(org.w3c.dom.Element annotationElement)
          Parses the 'deletable' status of the given feature type annotation element.
 boolean parseIsInsertable(org.w3c.dom.Element annotationElement)
          Parses the 'insertable' status of the given feature type annotation element.
 boolean parseIsPseudoFeatureType(org.w3c.dom.Element annotationElement)
          Parses the 'isPseudoFeatureType' element of the given feature type annotation element.
 boolean parseIsUpdatable(org.w3c.dom.Element annotationElement)
          Parses the 'updatable' status of the given feature type annotation element.
(package private)  MappedFeaturePropertyType parseMappedFeaturePropertyType(org.w3c.dom.Element element, QualifiedName propertyName, int minOccurs, int maxOccurs, boolean isIdentityPart, java.lang.String table, boolean isReferenceType)
          Extracts the mapping information for a feature property type from the given "xs:annotation" element.
(package private)  MappedGeometryPropertyType parseMappedGeometryPropertyType(org.w3c.dom.Element element, QualifiedName propertyName, QualifiedName typeName, int type, int minOccurs, int maxOccurs, boolean isIdentityPart, java.lang.String table)
          Extracts the mapping information for a geometry property type from the given "xs:annotation" element.
 MappedGMLSchema parseMappedGMLSchema()
          Returns the class representation of the underlying mapped GML schema document.
(package private)  MappedSimplePropertyType parseMappedSimplePropertyType(org.w3c.dom.Element element, QualifiedName propertyName, int type, int minOccurs, int maxOccurs, boolean isIdentityPart, java.lang.String table)
          Extracts the mapping information for a simple property type from the given "xs:annotation" element.
 java.net.URI[] parseOtherSRS(org.w3c.dom.Element annotationElement)
          Returns the values of the "deegreewfs:OtherSRS" elements.
(package private)  SpecialContent parseSpecialContent(org.w3c.dom.Element element)
          Parses the given "deegreewfs:SpecialContent" element.
(package private)  SQLFunctionCall parseSQLFunctionCall(org.w3c.dom.Element element, java.lang.String table)
          Parses the given element as a "deegreewfs:SQLFunctionCall" element.
 int parseVisible(org.w3c.dom.Element annotationElement)
          Returns the value of the "deegreewfs:visible" element.
 
Methods inherited from class org.deegree.model.feature.schema.GMLSchemaDocument
parseGMLSchema
 
Methods inherited from class org.deegree.framework.xml.schema.XSDocument
extractComplexTypeDeclarations, extractElementDeclarations, extractSimpleTypeDeclarations, getComplexTypeDeclaration, getFullName, getTargetNamespace, parseSimpleTypeDeclaration, parseXMLSchema
 
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

MappedGMLSchemaDocument

public MappedGMLSchemaDocument()
Method Detail

parseMappedGMLSchema

public MappedGMLSchema parseMappedGMLSchema()
                                     throws XMLParsingException,
                                            XMLSchemaException,
                                            UnknownCRSException
Returns the class representation of the underlying mapped GML schema document.

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

parseElementDeclaration

protected MappedElementDeclaration parseElementDeclaration(org.w3c.dom.Element element)
                                                    throws XMLParsingException
Parses the given Element as an annotated 'xs:element' declaration (with mapping information).

Overrides:
parseElementDeclaration in class XSDocument
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

parseComplexTypeDeclaration

protected MappedComplexTypeDeclaration parseComplexTypeDeclaration(org.w3c.dom.Element element)
                                                            throws XMLParsingException
Parses the given Element as an annotated 'xs:complexType' declaration (with mapping information).

Overrides:
parseComplexTypeDeclaration in class XSDocument
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

extractGMLId

MappedGMLId extractGMLId(org.w3c.dom.Element annotationElement,
                         java.lang.String defaultTableName)
                   throws XMLSchemaException
Extracts the "gml:id" information from the given "xs:annotation" element.

Parameters:
annotationElement - "xs:annotation" element
defaultTableName - name for table if "deegreewfs:table"-element is missing
Returns:
"gml:id" information as MappedGMLId
Throws:
XMLSchemaException - if a syntactic or semantic error is found

parseMappedSimplePropertyType

MappedSimplePropertyType parseMappedSimplePropertyType(org.w3c.dom.Element element,
                                                       QualifiedName propertyName,
                                                       int type,
                                                       int minOccurs,
                                                       int maxOccurs,
                                                       boolean isIdentityPart,
                                                       java.lang.String table)
                                                 throws XMLSchemaException
Extracts the mapping information for a simple property type from the given "xs:annotation" element.

Parameters:
element - "xs:annotation" element
propertyName - name of the property (local part is used as default field name if it is not specified explicitly in the "MappingField" element)
type -
minOccurs -
maxOccurs -
isIdentityPart -
table - name of the table that is associated with the feature type that this property belongs to
Returns:
simple property type with persistence information
Throws:
XMLSchemaException - if a syntactic or semantic error is found

parseConstantContent

ConstantContent parseConstantContent(org.w3c.dom.Element element)
                               throws XMLParsingException
Parses the given element as a "deegreewfs:Constant" element.

Parameters:
element - "deegreewfs:Constant" element
Returns:
java representation of element
Throws:
XMLParsingException

parseSpecialContent

SpecialContent parseSpecialContent(org.w3c.dom.Element element)
                             throws XMLParsingException
Parses the given "deegreewfs:SpecialContent" element.

Parameters:
element - "deegreewfs:SpecialContent" element
Returns:
java representation of element
Throws:
XMLParsingException

parseSQLFunctionCall

SQLFunctionCall parseSQLFunctionCall(org.w3c.dom.Element element,
                                     java.lang.String table)
                               throws XMLParsingException
Parses the given element as a "deegreewfs:SQLFunctionCall" element.

Parameters:
element - "deegreewfs:SQLFunctionCall" element
table -
Returns:
java representation of element
Throws:
XMLParsingException

parseFunctionParam

FunctionParam parseFunctionParam(org.w3c.dom.Element element,
                                 java.lang.String table)
                           throws XMLParsingException
Parses the given "deegreewfs:FunctionParam" element.

Valid child elements:

Parameters:
element - "deegreewfs:FunctionParam" element
table -
Returns:
java representation of element
Throws:
XMLParsingException

parseMappedGeometryPropertyType

MappedGeometryPropertyType parseMappedGeometryPropertyType(org.w3c.dom.Element element,
                                                           QualifiedName propertyName,
                                                           QualifiedName typeName,
                                                           int type,
                                                           int minOccurs,
                                                           int maxOccurs,
                                                           boolean isIdentityPart,
                                                           java.lang.String table)
                                                     throws XMLSchemaException,
                                                            UnknownCRSException
Extracts the mapping information for a geometry property type from the given "xs:annotation" element.

Parameters:
element - "xs:annotation" element
propertyName - name of the property (local part is used as default field name if it is not specified explicitly in the "MappingField" element)
typeName -
type -
minOccurs -
maxOccurs -
isIdentityPart -
table - name of the table that is associated with the feature type that this property belongs to
Returns:
geometry property type with persistence information
Throws:
XMLSchemaException - if a syntactic or semantic error is found
UnknownCRSException

parseMappedFeaturePropertyType

MappedFeaturePropertyType parseMappedFeaturePropertyType(org.w3c.dom.Element element,
                                                         QualifiedName propertyName,
                                                         int minOccurs,
                                                         int maxOccurs,
                                                         boolean isIdentityPart,
                                                         java.lang.String table,
                                                         boolean isReferenceType)
                                                   throws XMLSchemaException
Extracts the mapping information for a feature property type from the given "xs:annotation" element.

Parameters:
element - "xs:annotation" element
propertyName - name of the property (local part is used as default field name if it is not specified explicitly in the "MappingField" element)
minOccurs -
maxOccurs -
isIdentityPart -
table - name of the table that is associated with the feature type that this property belongs to
isReferenceType - true, if this property is of type "gml:ReferenceType", false otherwise
Returns:
feature property type with persistence information
Throws:
XMLSchemaException - if a syntactic or semantic error is found

parseVisible

public int parseVisible(org.w3c.dom.Element annotationElement)
                 throws XMLParsingException
Returns the value of the "deegreewfs:visible" element.

Parameters:
annotationElement -
Returns:
-1 if it is not present, 0 if it is "false", 1 if it is "true"
Throws:
XMLParsingException

parseIsUpdatable

public boolean parseIsUpdatable(org.w3c.dom.Element annotationElement)
                         throws XMLParsingException
Parses the 'updatable' status of the given feature type annotation element.

Parameters:
annotationElement -
Returns:
true, if update transactions may be performed on the feature type, false otherwise
Throws:
XMLParsingException

parseIsDeletable

public boolean parseIsDeletable(org.w3c.dom.Element annotationElement)
                         throws XMLParsingException
Parses the 'deletable' status of the given feature type annotation element.

Parameters:
annotationElement -
Returns:
true, if delete transactions may be performed on the feature type, false otherwise
Throws:
XMLParsingException

parseIsInsertable

public boolean parseIsInsertable(org.w3c.dom.Element annotationElement)
                          throws XMLParsingException
Parses the 'insertable' status of the given feature type annotation element.

Parameters:
annotationElement -
Returns:
true, if insert transactions may be performed on the feature type, false otherwise
Throws:
XMLParsingException

parseIsPseudoFeatureType

public boolean parseIsPseudoFeatureType(org.w3c.dom.Element annotationElement)
                                 throws XMLParsingException
Parses the 'isPseudoFeatureType' element of the given feature type annotation element.

Parameters:
annotationElement -
Returns:
true, if feature type is a pseudo feature type, false otherwise
Throws:
XMLParsingException

parseIdentityPart

public int parseIdentityPart(org.w3c.dom.Element annotationElement)
                      throws XMLParsingException
Returns the value of the "deegreewfs:IdentityPart" element.

Parameters:
annotationElement -
Returns:
-1 if it is not present, 0 if it is "false", 1 if it is "true"
Throws:
XMLParsingException

parseDefaultSRS

public java.net.URI parseDefaultSRS(org.w3c.dom.Element annotationElement,
                                    java.net.URI defaultValue)
                             throws XMLParsingException
Returns the value of the "deegreewfs:DefaultSRS" element.

Parameters:
annotationElement -
defaultValue -
Returns:
default SRS of the feature type
Throws:
XMLParsingException

parseOtherSRS

public java.net.URI[] parseOtherSRS(org.w3c.dom.Element annotationElement)
                             throws XMLParsingException
Returns the values of the "deegreewfs:OtherSRS" elements.

Parameters:
annotationElement -
Returns:
alternative SRS that may be used to query the feature type
Throws:
XMLParsingException

parseGMLDefaultProps

public java.util.LinkedList<Pair<PropertyType,QualifiedName>> parseGMLDefaultProps(org.w3c.dom.Element annotationElement,
                                                                                   java.lang.String table,
                                                                                   MappedGMLSchema schema)
                                                                            throws XMLParsingException
Parameters:
annotationElement -
table -
schema -
Returns:
a list of default GML properties to include. The qualified name specified (if not null), after which property this one should be included.
Throws:
XMLParsingException

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