deegree 2.3 (2010/04/09 10:10 build-4-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:
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(Element annotationElement, String defaultTableName)
          Extracts the "gml:id" information from the given "xs:annotation" element.
protected  MappedComplexTypeDeclaration parseComplexTypeDeclaration(Element element)
          Parses the given Element as an annotated 'xs:complexType' declaration (with mapping information).
(package private)  ConstantContent parseConstantContent(Element element)
          Parses the given element as a "deegreewfs:Constant" element.
 URI parseDefaultSRS(Element annotationElement, URI defaultValue)
          Returns the value of the "deegreewfs:DefaultSRS" element.
protected  MappedElementDeclaration parseElementDeclaration(Element element)
          Parses the given Element as an annotated 'xs:element' declaration (with mapping information).
(package private)  FunctionParam parseFunctionParam(Element element, String table)
          Parses the given "deegreewfs:FunctionParam" element.
 LinkedList<Pair<PropertyType,QualifiedName>> parseGMLDefaultProps(Element annotationElement, String table, MappedGMLSchema schema)
           
 int parseIdentityPart(Element annotationElement)
          Returns the value of the "deegreewfs:IdentityPart" element.
 boolean parseIsDeletable(Element annotationElement)
          Parses the 'deletable' status of the given feature type annotation element.
 boolean parseIsInsertable(Element annotationElement)
          Parses the 'insertable' status of the given feature type annotation element.
 boolean parseIsPseudoFeatureType(Element annotationElement)
          Parses the 'isPseudoFeatureType' element of the given feature type annotation element.
 boolean parseIsUpdatable(Element annotationElement)
          Parses the 'updatable' status of the given feature type annotation element.
(package private)  MappedFeaturePropertyType parseMappedFeaturePropertyType(Element element, QualifiedName propertyName, int minOccurs, int maxOccurs, boolean isIdentityPart, String table, boolean isReferenceType)
          Extracts the mapping information for a feature property type from the given "xs:annotation" element.
(package private)  MappedGeometryPropertyType parseMappedGeometryPropertyType(Element element, QualifiedName propertyName, QualifiedName typeName, int type, int minOccurs, int maxOccurs, boolean isIdentityPart, 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(Element element, QualifiedName propertyName, int type, int minOccurs, int maxOccurs, boolean isIdentityPart, String table)
          Extracts the mapping information for a simple property type from the given "xs:annotation" element.
 URI[] parseOtherSRS(Element annotationElement)
          Returns the values of the "deegreewfs:OtherSRS" elements.
(package private)  SpecialContent parseSpecialContent(Element element)
          Parses the given "deegreewfs:SpecialContent" element.
(package private)  SQLFunctionCall parseSQLFunctionCall(Element element, String table)
          Parses the given element as a "deegreewfs:SQLFunctionCall" element.
 int parseVisible(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(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(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(Element annotationElement,
                         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(Element element,
                                                       QualifiedName propertyName,
                                                       int type,
                                                       int minOccurs,
                                                       int maxOccurs,
                                                       boolean isIdentityPart,
                                                       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(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(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(Element element,
                                     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(Element element,
                                 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(Element element,
                                                           QualifiedName propertyName,
                                                           QualifiedName typeName,
                                                           int type,
                                                           int minOccurs,
                                                           int maxOccurs,
                                                           boolean isIdentityPart,
                                                           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(Element element,
                                                         QualifiedName propertyName,
                                                         int minOccurs,
                                                         int maxOccurs,
                                                         boolean isIdentityPart,
                                                         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(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(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(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(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(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(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 URI parseDefaultSRS(Element annotationElement,
                           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 URI[] parseOtherSRS(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 LinkedList<Pair<PropertyType,QualifiedName>> parseGMLDefaultProps(Element annotationElement,
                                                                         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.3 (2010/04/09 10:10 build-4-official)

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