org.geotools.gml.producer
Class FeatureTransformer.FeatureTranslator

java.lang.Object
  extended byorg.geotools.xml.transform.TransformerBase.TranslatorSupport
      extended byorg.geotools.gml.producer.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
 
Fields inherited from class org.geotools.xml.transform.TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, schemaLocation
 
Constructor Summary
FeatureTransformer.FeatureTranslator(org.xml.sax.ContentHandler handler, java.lang.String prefix, java.lang.String ns, FeatureTransformer.FeatureTypeNamespaces types, TransformerBase.SchemaLocationSupport schemaLoc)
          Constructor with handler.
 
Method Summary
 void encode(java.lang.Object o)
          Encode the object.
 void endFeature(Feature f)
          Sends sax for the ending of a feature.
 void endFeatureCollection()
           
 void endFeatureCollection(FeatureCollection collection)
          Sends sax for the ending of a feature collection.
 void handleAttribute(AttributeType type, java.lang.Object value)
          handles sax for an attribute.
 void handleFeature(Feature f)
          Handles sax for a feature.
 void handleFeatureCollection(FeatureCollection collection)
          Prints up the gml for a featurecollection.
 void handleFeatureReader(FeatureReader r)
           
 void setLockId(java.lang.String lockId)
           
 void startFeatureCollection()
           
 void writeBounds(com.vividsolutions.jts.geom.Envelope bounds)
          writes the gml:boundedBy element to output based on fc.getBounds()
 
Methods inherited from class org.geotools.xml.transform.TransformerBase.TranslatorSupport
abort, addNamespaceDeclarations, chars, element, element, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, start, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureTransformer.FeatureTranslator

public FeatureTransformer.FeatureTranslator(org.xml.sax.ContentHandler handler,
                                            java.lang.String prefix,
                                            java.lang.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

setLockId

public void setLockId(java.lang.String lockId)

encode

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

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

handleFeatureReader

public void handleFeatureReader(FeatureReader r)
                         throws java.io.IOException
Throws:
java.io.IOException

startFeatureCollection

public void startFeatureCollection()

endFeatureCollection

public void endFeatureCollection()

handleFeatureCollection

public void handleFeatureCollection(FeatureCollection collection)
Prints up the gml for a featurecollection.

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

writeBounds

public void writeBounds(com.vividsolutions.jts.geom.Envelope bounds)
writes the gml:boundedBy element to output based on fc.getBounds()

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

endFeatureCollection

public void endFeatureCollection(FeatureCollection 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(Feature f)
Sends sax for the ending of a feature.

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

handleAttribute

public void handleAttribute(AttributeType type,
                            java.lang.Object value)
handles sax for an attribute.

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

handleFeature

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

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


Copyright © GeoTools. All Rights Reserved.