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

org.deegree.model.feature
Class GMLFeatureAdapter

java.lang.Object
  extended by org.deegree.model.feature.GMLFeatureAdapter

public class GMLFeatureAdapter
extends java.lang.Object

Exports feature instances to their GML representation.

Has support for XLink output and to disable XLink output (which is generally not feasible).

Also responsible for "xlinking" features: if a feature occurs several times in a feature collection, it must be exported only once - all other occurences must use xlink-attributes in the surrounding property element to reference the feature. TODO Handle FeatureCollections like ordinary Features (needs changes in feature model). TODO Separate cycle check (for suppressXLinkOutput). TODO Use a more straight-forward approach to export DOM representations. TODO Handle multiple application schemas (in xsi:schemaLocation attribute). TODO Handle WFS-schema-binding in a subclass in the WFS package?

Version:
$Revision: 24539 $, $Date: 2010-05-25 11:04:40 +0200 (Di, 25 Mai 2010) $
Author:
Markus Schneider , last edited by: $Author: apoth $

Constructor Summary
GMLFeatureAdapter()
          Creates a new GMLFeatureAdapter instance with enabled XLink output.
GMLFeatureAdapter(boolean suppressXLinkOutput)
          Creates a new instance GMLFeatureAdapter with configurable XLink output.
GMLFeatureAdapter(boolean suppressXLinkOutput, java.lang.String schemaURL)
          Creates a new instance GMLFeatureAdapter with configurable XLink output.
GMLFeatureAdapter(boolean suppressXLinkOutput, java.lang.String schemaURL, boolean printGeometryIds)
           
GMLFeatureAdapter(boolean suppressXLinkOutput, java.lang.String schemaURL, boolean printGeometryIds, int depth)
           
GMLFeatureAdapter(boolean suppressXLinkOutput, java.lang.String schemaURL, java.lang.String wfsSchemaBinding, boolean printGeometryIds)
          Creates a new instance GMLFeatureAdapter with configurable XLink output.
GMLFeatureAdapter(boolean suppressXLinkOutput, java.lang.String schemaURL, java.lang.String wfsSchemaBinding, boolean printGeometryIds, int depth)
           
GMLFeatureAdapter(int xlinkdepth)
           
GMLFeatureAdapter(java.lang.String schemaURL)
          Creates a new GMLFeatureAdapter instance with enabled XLink output and schema reference.
 
Method Summary
 void append(org.w3c.dom.Element root, Feature feature)
          Appends the DOM representation of the given feature to the also given Node.
 void append(org.w3c.dom.Element root, FeatureCollection fc)
          Appends the DOM representation of the given FeatureCollection to the also given Node.
 GMLFeatureDocument export(Feature feature)
          Export a Feature to it's XML representation.
 GMLFeatureCollectionDocument export(FeatureCollection fc)
          Export a FeatureCollection to it's XML representation.
 void export(FeatureCollection fc, java.io.OutputStream os)
          Exports an instance of a FeatureCollection to the passed OutputStream formatted as GML.
 void export(FeatureCollection fc, java.io.OutputStream os, java.lang.String charsetName)
          Exports a FeatureCollection instance to the passed OutputStream formatted as GML.
 void export(Feature feature, java.io.OutputStream os)
          Exports an instance of a Feature to the passed OutputStream formatted as GML.
 void export(Feature feature, java.io.OutputStream os, java.lang.String charsetName)
          Exports a Feature instance to the passed OutputStream formatted as GML.
 void setBaseURL(java.lang.String url)
           
 void setPropertyPaths(java.util.Collection<PropertyPath[]> paths)
          Sets the property paths for which special xlink traversal will be done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLFeatureAdapter

public GMLFeatureAdapter()
Creates a new GMLFeatureAdapter instance with enabled XLink output.


GMLFeatureAdapter

public GMLFeatureAdapter(int xlinkdepth)
Parameters:
xlinkdepth -

GMLFeatureAdapter

public GMLFeatureAdapter(java.lang.String schemaURL)
Creates a new GMLFeatureAdapter instance with enabled XLink output and schema reference.

Parameters:
schemaURL - URL of schema document (used as xsi:schemaLocation attribute in XML output)

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput,
                         java.lang.String schemaURL,
                         boolean printGeometryIds)
Parameters:
suppressXLinkOutput -
schemaURL -
printGeometryIds -

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput,
                         java.lang.String schemaURL,
                         boolean printGeometryIds,
                         int depth)
Parameters:
suppressXLinkOutput -
schemaURL -
printGeometryIds -
depth - the depth of xlinks to resolve

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput)
Creates a new instance GMLFeatureAdapter with configurable XLink output.

Parameters:
suppressXLinkOutput - set to true, if no XLinks shall be used

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput,
                         java.lang.String schemaURL)
Creates a new instance GMLFeatureAdapter with configurable XLink output.

Parameters:
suppressXLinkOutput - set to true, if no XLinks shall be used
schemaURL - URL of schema document (used as xsi:schemaLocation attribute in XML output)

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput,
                         java.lang.String schemaURL,
                         java.lang.String wfsSchemaBinding,
                         boolean printGeometryIds)
Creates a new instance GMLFeatureAdapter with configurable XLink output.

Parameters:
suppressXLinkOutput - set to true, if no XLinks shall be used
schemaURL - URL of schema document (used for "xsi:schemaLocation" attribute in XML output)
wfsSchemaBinding - fragment for the "xsi:schemaLocation" attribute that binds the wfs namespace
printGeometryIds -

GMLFeatureAdapter

public GMLFeatureAdapter(boolean suppressXLinkOutput,
                         java.lang.String schemaURL,
                         java.lang.String wfsSchemaBinding,
                         boolean printGeometryIds,
                         int depth)
Parameters:
suppressXLinkOutput -
schemaURL -
wfsSchemaBinding -
printGeometryIds -
depth -
Method Detail

setPropertyPaths

public void setPropertyPaths(java.util.Collection<PropertyPath[]> paths)
Sets the property paths for which special xlink traversal will be done.

Parameters:
paths -

setBaseURL

public void setBaseURL(java.lang.String url)
Parameters:
url - the base url to use for GetGmlObject references

append

public void append(org.w3c.dom.Element root,
                   Feature feature)
            throws FeatureException,
                   java.io.IOException,
                   org.xml.sax.SAXException
Appends the DOM representation of the given feature to the also given Node.

TODO do this a better way (append nodes directly without serializing to string and parsing it again)

Parameters:
root -
feature -
Throws:
FeatureException
java.io.IOException
org.xml.sax.SAXException

export

public GMLFeatureDocument export(Feature feature)
                          throws java.io.IOException,
                                 FeatureException,
                                 XMLException,
                                 org.xml.sax.SAXException
Export a Feature to it's XML representation.

Parameters:
feature - feature to export
Returns:
XML representation of feature
Throws:
java.io.IOException
FeatureException
XMLException
org.xml.sax.SAXException

append

public void append(org.w3c.dom.Element root,
                   FeatureCollection fc)
            throws FeatureException,
                   java.io.IOException,
                   org.xml.sax.SAXException
Appends the DOM representation of the given FeatureCollection to the also given Node.

TODO do this a better way (append nodes directly without serializing to string and parsing it again)

Parameters:
root -
fc -
Throws:
FeatureException
java.io.IOException
org.xml.sax.SAXException

export

public GMLFeatureCollectionDocument export(FeatureCollection fc)
                                    throws java.io.IOException,
                                           FeatureException,
                                           XMLException,
                                           org.xml.sax.SAXException
Export a FeatureCollection to it's XML representation.

Parameters:
fc - feature collection
Returns:
XML representation of feature collection
Throws:
java.io.IOException
FeatureException
XMLException
org.xml.sax.SAXException

export

public void export(FeatureCollection fc,
                   java.io.OutputStream os)
            throws java.io.IOException,
                   FeatureException
Exports an instance of a FeatureCollection to the passed OutputStream formatted as GML. Uses the deegree system character set for the XML header encoding information.

Parameters:
fc - feature collection to export
os - output stream to write to
Throws:
java.io.IOException
FeatureException

export

public void export(FeatureCollection fc,
                   java.io.OutputStream os,
                   java.lang.String charsetName)
            throws java.io.IOException,
                   FeatureException
Exports a FeatureCollection instance to the passed OutputStream formatted as GML.

Parameters:
fc - feature collection to export
os - output stream to write to
charsetName - name of the used charset/encoding (for the XML header)
Throws:
java.io.IOException
FeatureException

export

public void export(Feature feature,
                   java.io.OutputStream os)
            throws java.io.IOException,
                   FeatureException
Exports an instance of a Feature to the passed OutputStream formatted as GML. Uses the deegree system character set for the XML header encoding information.

Parameters:
feature - feature to export
os - output stream to write to
Throws:
java.io.IOException
FeatureException

export

public void export(Feature feature,
                   java.io.OutputStream os,
                   java.lang.String charsetName)
            throws java.io.IOException,
                   FeatureException
Exports a Feature instance to the passed OutputStream formatted as GML.

Parameters:
feature - feature to export
os - output stream to write to
charsetName - name of the used charset/encoding (for the XML header)
Throws:
java.io.IOException
FeatureException

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