Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.gml.writer.internal.geometry
Class StreamGeometryWriter

java.lang.Object
  extended by eu.esdihumboldt.hale.io.gml.writer.internal.geometry.AbstractTypeMatcher<Class<? extends com.vividsolutions.jts.geom.Geometry>>
      extended by eu.esdihumboldt.hale.io.gml.writer.internal.geometry.StreamGeometryWriter

public class StreamGeometryWriter
extends AbstractTypeMatcher<Class<? extends com.vividsolutions.jts.geom.Geometry>>

Write geometries for a GML document.

Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Constructor Summary
StreamGeometryWriter(String gmlNs, boolean simplifyGeometry)
          Constructor
 
Method Summary
 List<DefinitionPath> findCandidates(PropertyDefinition property, Class<? extends com.vividsolutions.jts.geom.Geometry> geomType)
          Find candidates for a possible path to use for writing the geometry
static StreamGeometryWriter getDefaultInstance(String gmlNs, boolean simplifyGeometry)
          Get a geometry writer instance with a default configuration.
protected  DefinitionPath matchPath(TypeDefinition type, Class<? extends com.vividsolutions.jts.geom.Geometry> geomType, DefinitionPath path)
          Determines if a type definition is compatible to a geometry type
 void registerGeometryWriter(GeometryWriter<?> writer)
          Register a geometry writer
 void write(XMLStreamWriter writer, com.vividsolutions.jts.geom.Geometry geometry, PropertyDefinition property, String srsName)
          Write a geometry to a stream for a GML document
 
Methods inherited from class eu.esdihumboldt.hale.io.gml.writer.internal.geometry.AbstractTypeMatcher
findCandidates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamGeometryWriter

public StreamGeometryWriter(String gmlNs,
                            boolean simplifyGeometry)
Constructor

Parameters:
gmlNs - the GML namespace
simplifyGeometry - if geometries should be simplified before writing them if possible (e.g. a MultiGeometry with only one geometry is reduced to the contained geometry)
Method Detail

getDefaultInstance

public static StreamGeometryWriter getDefaultInstance(String gmlNs,
                                                      boolean simplifyGeometry)
Get a geometry writer instance with a default configuration.

Parameters:
gmlNs - the GML namespace
simplifyGeometry - if geometries should be simplified before writing them if possible (e.g. a MultiGeometry with only one geometry is reduced to the contained geometry)
Returns:
the geometry writer

registerGeometryWriter

public void registerGeometryWriter(GeometryWriter<?> writer)
Register a geometry writer

Parameters:
writer - the geometry writer

write

public void write(XMLStreamWriter writer,
                  com.vividsolutions.jts.geom.Geometry geometry,
                  PropertyDefinition property,
                  String srsName)
           throws XMLStreamException
Write a geometry to a stream for a GML document

Parameters:
writer - the XML stream writer
geometry - the geometry
property - the geometry property
srsName - the SRS name of a common SRS for the whole document, may be null
Throws:
XMLStreamException - if any error occurs writing the geometry

findCandidates

public List<DefinitionPath> findCandidates(PropertyDefinition property,
                                           Class<? extends com.vividsolutions.jts.geom.Geometry> geomType)
Find candidates for a possible path to use for writing the geometry

Parameters:
property - the start property
geomType - the geometry type
Returns:
the path candidates

matchPath

protected DefinitionPath matchPath(TypeDefinition type,
                                   Class<? extends com.vividsolutions.jts.geom.Geometry> geomType,
                                   DefinitionPath path)
Determines if a type definition is compatible to a geometry type

Specified by:
matchPath in class AbstractTypeMatcher<Class<? extends com.vividsolutions.jts.geom.Geometry>>
Parameters:
type - the type definition
geomType - the geometry type
path - the current definition path
Returns:
the (eventually updated) definition path if a match is found, otherwise null

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d