public class GenericFeatureConverter extends AbstractFeatureConverter
Metacard
to XML according to
the GML 2.1.2 spec. It will also convert respective XML into a Metacard.coordinateOrder, ERROR_PARSING_MESSAGE, EXT_PREFIX, metacardType, prefix, UTF8_ENCODING, wfsUrl
Constructor and Description |
---|
GenericFeatureConverter() |
GenericFeatureConverter(MetacardMapper metacardMapper) |
GenericFeatureConverter(String srs) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Class clazz)
Method to determine if this converter knows how to convert the specified Class.
|
void |
marshal(Object value,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
com.thoughtworks.xstream.converters.MarshallingContext context)
This method will convert a
Metacard instance into xml that will validate against the
GML 2.1.2 AbstractFeatureType. |
void |
setSourceId(String sourceId)
set the source ID on the converter to be used when converting features into metacards
|
Object |
unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader hreader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
This method will unmarshal an XML instance of a "gml:featureMember" to a
Metacard . |
copyXml, createMetacardFromFeature, getMetacardType, getValueForMetacardAttribute, isAttributeNotNull, parseDateFromXml, setCoordinateOrder, setMetacardType, setSrs, setWfsUrl
public GenericFeatureConverter()
public GenericFeatureConverter(String srs)
public GenericFeatureConverter(MetacardMapper metacardMapper)
public boolean canConvert(Class clazz)
canConvert
in interface com.thoughtworks.xstream.converters.ConverterMatcher
canConvert
in class AbstractFeatureConverter
clazz
- the class to checkpublic void marshal(Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
Metacard
instance into xml that will validate against the
GML 2.1.2 AbstractFeatureType.value
- the Metacard
to convertwriter
- the stream writer responsible for writing this xml doccontext
- a reference back to the Xstream marshalling context. Allows you to call
"convertAnother" which will lookup other registered converters.public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader hreader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
Metacard
.hreader
- the stream reader responsible for reading this xml doccontext
- a reference back to the Xstream unmarshalling context. Allows you to call
"convertAnother" which will lookup other registered converters.public void setSourceId(String sourceId)
FeatureConverter
setSourceId
in interface FeatureConverter
setSourceId
in class AbstractFeatureConverter
This work is licensed under a Creative Commons Attribution 4.0 International License.