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

public class GenericFeatureConverter extends AbstractFeatureConverter
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.
  • Constructor Details

    • GenericFeatureConverter

      public GenericFeatureConverter()
    • GenericFeatureConverter

      public GenericFeatureConverter(String srs)
    • GenericFeatureConverter

      public GenericFeatureConverter(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper)
  • Method Details

    • canConvert

      public boolean canConvert(Class clazz)
      Method to determine if this converter knows how to convert the specified Class.
      Specified by:
      canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
      Overrides:
      canConvert in class AbstractFeatureConverter
      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 a Metacard instance into xml that will validate against the GML 2.1.2 AbstractFeatureType.
      Parameters:
      value - the Metacard to convert
      writer - the stream writer responsible for writing this xml doc
      context - 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 a Metacard.
      Parameters:
      hreader - the stream reader responsible for reading this xml doc
      context - a reference back to the Xstream unmarshalling context. Allows you to call "convertAnother" which will lookup other registered converters.
    • setSourceId

      public void setSourceId(String sourceId)
      Specified by:
      setSourceId in interface org.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter
      Overrides:
      setSourceId in class AbstractFeatureConverter