deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.feature
Class GMLFeatureAdapter

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

public class GMLFeatureAdapter
extends 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).

Version:
$Revision: 9343 $, $Date: 2007-12-27 14:30:32 +0100 (Do, 27 Dez 2007) $
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, String schemaURL)
          Creates a new instance GMLFeatureAdapter with configurable XLink output.
GMLFeatureAdapter(String schemaURL)
          Creates a new GMLFeatureAdapter instance with enabled XLink output and schema reference.
 
Method Summary
 void append(Element root, Feature feature)
          Appends the DOM representation of the given feature to the also given Node.
 void append(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, OutputStream os)
          Exports an instance of a FeatureCollection to the passed OutputStream formatted as GML.
 void export(FeatureCollection fc, OutputStream os, String charsetName)
          Exports a FeatureCollection instance to the passed OutputStream formatted as GML.
 void export(Feature feature, OutputStream os)
          Exports an instance of a Feature to the passed OutputStream formatted as GML.
 void export(Feature feature, OutputStream os, String charsetName)
          Exports a Feature instance to the passed OutputStream formatted as GML.
 
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(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)
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,
                         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)
Method Detail

append

public void append(Element root,
                   Feature feature)
            throws FeatureException,
                   IOException,
                   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
IOException
SAXException

export

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

Parameters:
feature - feature to export
Returns:
XML representation of feature
Throws:
IOException
FeatureException
XMLException
SAXException

append

public void append(Element root,
                   FeatureCollection fc)
            throws FeatureException,
                   IOException,
                   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
IOException
SAXException

export

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

Parameters:
fc - feature collection
Returns:
XML representation of feature collection
Throws:
IOException
FeatureException
XMLException
SAXException

export

public void export(FeatureCollection fc,
                   OutputStream os)
            throws 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:
IOException
FeatureException

export

public void export(FeatureCollection fc,
                   OutputStream os,
                   String charsetName)
            throws 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:
IOException
FeatureException

export

public void export(Feature feature,
                   OutputStream os)
            throws 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:
IOException
FeatureException

export

public void export(Feature feature,
                   OutputStream os,
                   String charsetName)
            throws 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:
IOException
FeatureException

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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