org.geotools.gml.producer
Class FeatureTransformer.FeatureTranslator

Object
  extended by TransformerBase.TranslatorSupport
      extended by FeatureTransformer.FeatureTranslator
All Implemented Interfaces:
FeatureCollectionIteration.Handler, Translator
Enclosing class:
FeatureTransformer

public static class FeatureTransformer.FeatureTranslator
extends TransformerBase.TranslatorSupport
implements FeatureCollectionIteration.Handler

Outputs gml without any fancy indents or newlines.


Field Summary
protected  GeometryTransformer.GeometryTranslator geometryTranslator
           
 
Fields inherited from class TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, schemaLocation
 
Constructor Summary
FeatureTransformer.FeatureTranslator(ContentHandler handler, String prefix, String ns, FeatureTransformer.FeatureTypeNamespaces types, TransformerBase.SchemaLocationSupport schemaLoc)
          Constructor with handler.
 
Method Summary
protected  GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler)
          Method to be subclassed to return a custom geometry translator, mostly for gml3 geometry support.
protected  GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals)
           
protected  GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals, boolean useDummyZ)
           
protected  GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals, int dimension)
          Set up a GeometryTranslator for working with content of the indicate dimension.
 void encode(Object o)
          Encode the object.
protected  Attributes encodeFeatureId(SimpleFeature f)
           
 void endFeature(SimpleFeature f)
          Sends sax for the ending of a feature.
 void endFeatureCollection()
           
 void endFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
          Sends sax for the ending of a feature collection.
 FeatureTransformer.FeatureTypeNamespaces getFeatureTypeNamespaces()
           
 void handleAttribute(AttributeDescriptor descriptor, Object value)
          handles sax for an attribute.
 void handleFeature(SimpleFeature f)
          Handles sax for a feature.
 void handleFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
          Prints up the gml for a featurecollection.
 void handleFeatureIterator(FeatureIterator<SimpleFeature> iterator)
           
 void handleFeatureReader(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
           
 void setLockId(String lockId)
           
 void startFeatureCollection()
           
 void writeBounds(BoundingBox bounds)
          writes the gml:boundedBy element to output based on fc.getBounds()
 void writeNullBounds()
          writes null bounds to the output
 
Methods inherited from class TransformerBase.TranslatorSupport
abort, addNamespaceDeclarations, cdata, chars, createAttributes, element, element, elementSafe, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, start, start
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geometryTranslator

protected GeometryTransformer.GeometryTranslator geometryTranslator
Constructor Detail

FeatureTransformer.FeatureTranslator

public FeatureTransformer.FeatureTranslator(ContentHandler handler,
                                            String prefix,
                                            String ns,
                                            FeatureTransformer.FeatureTypeNamespaces types,
                                            TransformerBase.SchemaLocationSupport schemaLoc)
Constructor with handler.

Parameters:
handler - the handler to use.
prefix - DOCUMENT ME!
ns - DOCUMENT ME!
types - DOCUMENT ME!
schemaLoc - DOCUMENT ME!
Method Detail

createGeometryTranslator

protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler)
Method to be subclassed to return a custom geometry translator, mostly for gml3 geometry support.

Parameters:
handler -
Returns:

createGeometryTranslator

protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler,
                                                                          int numDecimals)

createGeometryTranslator

protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler,
                                                                          int numDecimals,
                                                                          boolean useDummyZ)
Parameters:
handler -
numDecimals -
useDummyZ -
Returns:

createGeometryTranslator

protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler,
                                                                          int numDecimals,
                                                                          int dimension)
Set up a GeometryTranslator for working with content of the indicate dimension.

This method can be used by code explicitly wishing to output 2D ordinates.

Parameters:
handler -
numDecimals -
dimension -
Returns:
GeometryTranslator that will delegate a CoordinateWriter configured with the above parameters
Since:
2.4.1

setLockId

public void setLockId(String lockId)

getFeatureTypeNamespaces

public FeatureTransformer.FeatureTypeNamespaces getFeatureTypeNamespaces()

encode

public void encode(Object o)
            throws IllegalArgumentException
Description copied from interface: Translator
Encode the object.

Specified by:
encode in interface Translator
Parameters:
o - The Object to encode.
Throws:
IllegalArgumentException - if the Object is not encodeable.

handleFeatureIterator

public void handleFeatureIterator(FeatureIterator<SimpleFeature> iterator)
                           throws IOException
Throws:
IOException

handleFeatureReader

public void handleFeatureReader(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
                         throws IOException
Throws:
IOException

startFeatureCollection

public void startFeatureCollection()

endFeatureCollection

public void endFeatureCollection()

handleFeatureCollection

public void handleFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
Prints up the gml for a featurecollection.

Specified by:
handleFeatureCollection in interface FeatureCollectionIteration.Handler
Parameters:
collection - DOCUMENT ME!

writeBounds

public void writeBounds(BoundingBox bounds)
writes the gml:boundedBy element to output based on fc.getBounds()

Parameters:
bounds -
Throws:
RuntimeException - if it is thorwn while writing the element or coordinates

writeNullBounds

public void writeNullBounds()
writes null bounds to the output

Throws:
RuntimeException - if it is thorwn while writing the element or coordinates

endFeatureCollection

public void endFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
Sends sax for the ending of a feature collection.

Specified by:
endFeatureCollection in interface FeatureCollectionIteration.Handler
Parameters:
collection - DOCUMENT ME!

endFeature

public void endFeature(SimpleFeature f)
Sends sax for the ending of a feature.

Specified by:
endFeature in interface FeatureCollectionIteration.Handler
Parameters:
f - DOCUMENT ME!
Throws:
RuntimeException - DOCUMENT ME!

handleAttribute

public void handleAttribute(AttributeDescriptor descriptor,
                            Object value)
handles sax for an attribute.

Specified by:
handleAttribute in interface FeatureCollectionIteration.Handler
Parameters:
descriptor - DOCUMENT ME!
value - DOCUMENT ME!
Throws:
RuntimeException - DOCUMENT ME!

handleFeature

public void handleFeature(SimpleFeature f)
Handles sax for a feature.

Specified by:
handleFeature in interface FeatureCollectionIteration.Handler
Parameters:
f - DOCUMENT ME!
Throws:
RuntimeException - DOCUMENT ME!

encodeFeatureId

protected Attributes encodeFeatureId(SimpleFeature f)


Copyright © 1996-2009 Geotools. All Rights Reserved.