Class CswUnmarshallHelper

java.lang.Object
org.codice.ddf.spatial.ogc.csw.catalog.converter.CswUnmarshallHelper

public class CswUnmarshallHelper extends Object
  • Method Details

    • convertToDate

      public static Date convertToDate(String value)
    • removeExistingAttributes

      public static void removeExistingAttributes(Map<String,String> cswAttrMap, Map<String,String> mappingObj)
    • convertToCswField

      public static String convertToCswField(String name)
    • createMetacardFromCswRecord

      public static MetacardImpl createMetacardFromCswRecord(ddf.catalog.data.MetacardType metacardType, com.thoughtworks.xstream.io.HierarchicalStreamReader hreader, CswAxisOrder cswAxisOrder, Map<String,String> namespaceMap)
    • getMetacardAttributeFromCswAttribute

      public static ddf.catalog.data.Attribute getMetacardAttributeFromCswAttribute(ddf.catalog.data.MetacardType metacardType, String cswAttributeName, Serializable cswAttributeValue, String metacardAttributeName)
      Takes a CSW attribute as a name and value and returns an Attribute whose value is cswAttributeValue converted to the type of the attribute metacardAttributeName in a Metacard.
      Parameters:
      cswAttributeName - the name of the CSW attribute
      cswAttributeValue - the value of the CSW attribute
      metacardAttributeName - the name of the Metacard attribute whose type cswAttributeValue will be converted to
      Returns:
      an Attribute with the name metacardAttributeName and the value cswAttributeValue converted to the type of the attribute metacardAttributeName in a Metacard.
    • convertStringValueToMetacardValue

      public static Serializable convertStringValueToMetacardValue(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, String value)
      Converts properties in CSW records that overlap with same name as a basic Metacard attribute, e.g., title. This conversion method is needed mainly because CSW records express all dates as strings, whereas MetacardImpl expresses them as java.util.Date types.
      Parameters:
      attributeFormat - the format of the attribute to be converted
      value - the value to be converted
      Returns:
      the value that was extracted from reader and is of the type described by attributeFormat
    • convertRecordPropertyToMetacardAttribute

      public static Serializable convertRecordPropertyToMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, CswAxisOrder cswAxisOrder)
      Converts the CSW record property reader is currently at to the specified Metacard attribute format.
      Parameters:
      reader - the reader at the element whose value you want to convert
      cswAxisOrder - the order of the coordinates in the XML being read by reader
      Returns:
      the value that was extracted from reader and is of the type described by attributeFormat