Class CswUnmarshallHelper
java.lang.Object
org.codice.ddf.spatial.ogc.csw.catalog.converter.CswUnmarshallHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic SerializableconvertRecordPropertyToMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, CswAxisOrder cswAxisOrder) Converts the CSW record propertyreaderis currently at to the specified Metacard attribute format.static SerializableconvertStringValueToMetacardValue(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.static StringconvertToCswField(String name) static DateconvertToDate(String value) static MetacardImplcreateMetacardFromCswRecord(ddf.catalog.data.MetacardType metacardType, com.thoughtworks.xstream.io.HierarchicalStreamReader hreader, CswAxisOrder cswAxisOrder, Map<String, String> namespaceMap) static ddf.catalog.data.AttributegetMetacardAttributeFromCswAttribute(ddf.catalog.data.MetacardType metacardType, String cswAttributeName, Serializable cswAttributeValue, String metacardAttributeName) Takes a CSW attribute as a name and value and returns anAttributewhose value iscswAttributeValueconverted to the type of the attributemetacardAttributeNamein aMetacard.static void
-
Method Details
-
convertToDate
-
removeExistingAttributes
-
convertToCswField
-
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 anAttributewhose value iscswAttributeValueconverted to the type of the attributemetacardAttributeNamein aMetacard.- Parameters:
cswAttributeName- the name of the CSW attributecswAttributeValue- the value of the CSW attributemetacardAttributeName- the name of theMetacardattribute whose typecswAttributeValuewill be converted to- Returns:
- an
Attributewith the namemetacardAttributeNameand the valuecswAttributeValueconverted to the type of the attributemetacardAttributeNamein aMetacard.
-
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 convertedvalue- the value to be converted- Returns:
- the value that was extracted from
readerand is of the type described byattributeFormat
-
convertRecordPropertyToMetacardAttribute
public static Serializable convertRecordPropertyToMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, CswAxisOrder cswAxisOrder) Converts the CSW record propertyreaderis currently at to the specified Metacard attribute format.- Parameters:
reader- the reader at the element whose value you want to convertcswAxisOrder- the order of the coordinates in the XML being read byreader- Returns:
- the value that was extracted from
readerand is of the type described byattributeFormat
-