|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTransformerBase.TranslatorSupport
FeatureTransformer.FeatureTranslator
public static class FeatureTransformer.FeatureTranslator
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(Feature f)
|
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. |
FeatureTransformer.FeatureTypeNamespaces |
getFeatureTypeNamespaces()
|
void |
handleAttribute(PropertyDescriptor descriptor,
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 |
handleFeatureIterator(SimpleFeatureIterator 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, comment, commit, createAttributes, element, element, elementSafe, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, mark, reset, start, start |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected GeometryTransformer.GeometryTranslator geometryTranslator
Constructor Detail |
---|
public FeatureTransformer.FeatureTranslator(ContentHandler handler, String prefix, String ns, FeatureTransformer.FeatureTypeNamespaces types, TransformerBase.SchemaLocationSupport schemaLoc)
handler
- the handler to use.prefix
- prefixns
- namespacetypes
- Capture namespace and prefix information for typesschemaLoc
- Schema location informationMethod Detail |
---|
protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler)
handler
-
protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals)
protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals, boolean useDummyZ)
handler
- numDecimals
- useDummyZ
-
protected GeometryTransformer.GeometryTranslator createGeometryTranslator(ContentHandler handler, int numDecimals, int dimension)
This method can be used by code explicitly wishing to output 2D ordinates.
handler
- numDecimals
- dimension
-
public void setLockId(String lockId)
public FeatureTransformer.FeatureTypeNamespaces getFeatureTypeNamespaces()
public void encode(Object o) throws IllegalArgumentException
Translator
encode
in interface Translator
o
- The Object to encode.
IllegalArgumentException
- if the Object is not encodeable.public void handleFeatureIterator(SimpleFeatureIterator iterator) throws IOException
IOException
public void handleFeatureReader(FeatureReader<SimpleFeatureType,SimpleFeature> reader) throws IOException
IOException
public void startFeatureCollection()
public void endFeatureCollection()
public void handleFeatureCollection(FeatureCollection<?,?> collection)
handleFeatureCollection
in interface FeatureCollectionIteration.Handler
collection
- FeatureCollection being encodedpublic void writeBounds(BoundingBox bounds)
gml:boundedBy
element to output based on
fc.getBounds()
bounds
-
RuntimeException
- if it is thorwn while writing the element
or coordinatespublic void writeNullBounds()
RuntimeException
- if it is thorwn while writing the element
or coordinatespublic void endFeatureCollection(FeatureCollection<?,?> collection)
endFeatureCollection
in interface FeatureCollectionIteration.Handler
collection
- Feature collection we have just finished encodingpublic void endFeature(Feature f)
endFeature
in interface FeatureCollectionIteration.Handler
f
- Feature (implementation assume a SimpleFeature)
RuntimeException
- if something goes wrong during encode it is wrapped up as a generic runtime exceptionpublic void handleAttribute(PropertyDescriptor descriptor, Object value)
handleAttribute
in interface FeatureCollectionIteration.Handler
descriptor
- Property descriptorvalue
- Value being encoded for this property
RuntimeException
- Any problems are bundled up in a generic runtime exceptionpublic void handleFeature(Feature f)
Please take care when considering the prefix/namespace for the feature. It is defined by either:
handleFeature
in interface FeatureCollectionIteration.Handler
f
- Feature being encoded
RuntimeException
- Used to report any troubles during encodingprotected Attributes encodeFeatureId(Feature f)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |