Class GenericFeatureConverter
java.lang.Object
org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.GenericFeatureConverter
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher,org.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter
This class works in conjunction with XStream to convert a
Metacard to XML according to
the GML 2.1.2 spec. It will also convert respective XML into a Metacard.-
Field Summary
Fields inherited from class org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
coordinateOrder, ERROR_PARSING_MESSAGE, metacardType, sourceId, UTF8_ENCODING, wfsUrl -
Constructor Summary
ConstructorsConstructorDescriptionGenericFeatureConverter(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class clazz) Method to determine if this converter knows how to convert the specified Class.voidmarshal(Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) This method will convert aMetacardinstance into xml that will validate against the GML 2.1.2 AbstractFeatureType.voidsetSourceId(String sourceId) 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 aMetacard.Methods inherited from class org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
copyXml, createMetacardFromFeature, getMetacardType, getSrs, getValueForMetacardAttribute, parseDateFromXml, setCoordinateOrder, setMetacardType, setSrs, setWfsUrl
-
Constructor Details
-
GenericFeatureConverter
public GenericFeatureConverter() -
GenericFeatureConverter
-
GenericFeatureConverter
public GenericFeatureConverter(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper)
-
-
Method Details
-
canConvert
Method to determine if this converter knows how to convert the specified Class.- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher- Overrides:
canConvertin classAbstractFeatureConverter- Parameters:
clazz- the class to check
-
marshal
public void marshal(Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) This method will convert aMetacardinstance into xml that will validate against the GML 2.1.2 AbstractFeatureType.- Parameters:
value- theMetacardto 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.
-
unmarshal
public 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 aMetacard.- Parameters:
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.
-
setSourceId
- Specified by:
setSourceIdin interfaceorg.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter- Overrides:
setSourceIdin classAbstractFeatureConverter
-