deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.gml
Class GMLStreamWriter

java.lang.Object
  extended by org.deegree.gml.GMLStreamWriter

public class GMLStreamWriter
extends Object

Stream-based writer for all kinds of GML objects supported by deegree.

Instances of this class are not thread-safe.

Version:
$Revision: 22216 $, $Date: 2010-01-26 16:41:09 +0100 (Di, 26 Jan 2010) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
GMLObject, GMLOutputFactory

Constructor Summary
GMLStreamWriter(GMLVersion version, XMLStreamWriter xmlStream)
          Creates a new GMLStreamWriter instance.
 
Method Summary
 void close()
          Closes the underlying XML stream.
 XMLStreamWriter getXMLStream()
          Returns the underlying XML stream.
 boolean isObjectExported(String gmlId)
          Returns whether the specified gml object has already been exported.
 void setAutoNamespaceBinding(boolean autoNs)
           
 void setCoordinateFormatter(CoordinateFormatter formatter)
          Controls the format (e.g. number of decimal places) for written coordinates.
 void setFeatureProperties(PropertyName[] featureProps)
          Sets the feature properties to be included for exported Feature instances.
 void setIndentation(String indentString)
          Controls the indentation of the generated XML.
 void setLocalXLinkTemplate(String localXLinkTemplate)
          Controls the representation of local xlinks.
 void setOutputCRS(CRS crs)
          Controls the output CRS for written geometries.
 void setSchemaLocation(String schemaLocation)
          Controls the value of the xsi:schemaLocation attribute in the root element.
 void setXLinkExpansion(int inlineXLinklevels)
          Controls the number of xlink levels that will be expanded inside property elements.
 void write(Definition definition)
          Writes a GML representation of the given Definition to the stream.
 void write(Feature feature)
          Writes a GML representation of the given Feature to the stream.
 void write(Geometry geometry)
          Writes a GML representation of the given Geometry to the stream.
 void write(GMLObject object)
          Writes a GML representation of the given GMLObject to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLStreamWriter

GMLStreamWriter(GMLVersion version,
                XMLStreamWriter xmlStream)
          throws XMLStreamException
Creates a new GMLStreamWriter instance.

Parameters:
version - GML version of the output, must not be null
xmlStream - XML stream used to write the output, must not be null
Throws:
XMLStreamException
Method Detail

setIndentation

public void setIndentation(String indentString)
Controls the indentation of the generated XML.

Parameters:
indentString - string to be used for one level of indentation (must be some combination of whitespaces), can be null (turns off indentation)

setXLinkExpansion

public void setXLinkExpansion(int inlineXLinklevels)
Controls the number of xlink levels that will be expanded inside property elements.

Parameters:
inlineXLinklevels - number of xlink levels to be expanded, -1 expands to any depth

setLocalXLinkTemplate

public void setLocalXLinkTemplate(String localXLinkTemplate)
Controls the representation of local xlinks.

Parameters:
localXLinkTemplate - template used to create references to local objects, e.g. http://localhost:8080/d3_wfs_lab/services?SERVICE=WFS&REQUEST=GetGmlObject&VERSION=1.1.0&TRAVERSEXLINKDEPTH=1&GMLOBJECTID={} , the substring {} is replaced by the object id

setFeatureProperties

public void setFeatureProperties(PropertyName[] featureProps)
Sets the feature properties to be included for exported Feature instances.

Parameters:
featureProps - feature properties to be included, or null (include all feature props)

setOutputCRS

public void setOutputCRS(CRS crs)
Controls the output CRS for written geometries.

Parameters:
crs - crs to be used for the geometries, can be null (keeps the original CRS)

setCoordinateFormatter

public void setCoordinateFormatter(CoordinateFormatter formatter)
Controls the format (e.g. number of decimal places) for written coordinates.

Parameters:
formatter - formatter to use, may be null (use 5 decimal places)

setSchemaLocation

public void setSchemaLocation(String schemaLocation)
Controls the value of the xsi:schemaLocation attribute in the root element.

Parameters:
schemaLocation - value to be exported in the xsi:schemaLocation attribute in the root element, or null (no xsi:schemaLocation attribute will be exported)

setAutoNamespaceBinding

public void setAutoNamespaceBinding(boolean autoNs)

isObjectExported

public boolean isObjectExported(String gmlId)
Returns whether the specified gml object has already been exported.

Parameters:
gmlId - id of the object, must not be null
Returns:
true, if the object has been exported, false otherwise

write

public void write(GMLObject object)
           throws XMLStreamException,
                  UnknownCRSException,
                  TransformationException
Writes a GML representation of the given GMLObject to the stream.

Parameters:
object - object to be written, must not be null
Throws:
XMLStreamException
UnknownCRSException
TransformationException

write

public void write(Feature feature)
           throws XMLStreamException,
                  UnknownCRSException,
                  TransformationException
Writes a GML representation of the given Feature to the stream.

Parameters:
feature - object to be written, must not be null
Throws:
XMLStreamException
UnknownCRSException
TransformationException

write

public void write(Geometry geometry)
           throws XMLStreamException,
                  UnknownCRSException,
                  TransformationException
Writes a GML representation of the given Geometry to the stream.

Parameters:
geometry - object to be written, must not be null
Throws:
XMLStreamException
UnknownCRSException
TransformationException

write

public void write(Definition definition)
           throws XMLStreamException
Writes a GML representation of the given Definition to the stream.

Parameters:
definition - object to be written, must not be null
Throws:
XMLStreamException

close

public void close()
           throws XMLStreamException
Closes the underlying XML stream.

Throws:
XMLStreamException

getXMLStream

public XMLStreamWriter getXMLStream()
Returns the underlying XML stream.

Returns:
the underlying XML stream, never null

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>