Class SimpleXpathDateFormatMetadataContributor
- java.lang.Object
-
- org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor
-
- org.dspace.importer.external.metadatamapping.contributor.SimpleXpathDateFormatMetadataContributor
-
- All Implemented Interfaces:
MetadataContributor<org.jdom2.Element>
public class SimpleXpathDateFormatMetadataContributor extends SimpleXpathMetadatumContributor
This contributor can be used when parsing an XML file, particularly to extract a date and convert it to a specific format. In the variable dateFormatFrom the read format should be configured, instead in the variable dateFormatTo the format you want to obtain.- Author:
- Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com)
-
-
Field Summary
-
Fields inherited from class org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor
field, metadataFieldMapping, prefixToNamespaceMapping, query
-
-
Constructor Summary
Constructors Constructor Description SimpleXpathDateFormatMetadataContributor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<MetadatumDTO>contributeMetadata(org.jdom2.Element element)Retrieve the metadata associated with the given object.voidsetDateFormatFrom(String dateFormatFrom)voidsetDateFormatTo(String dateFormatTo)-
Methods inherited from class org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor
getField, getMetadataFieldMapping, getPrefixToNamespaceMapping, getQuery, setField, setMetadataFieldMapping, setPrefixToNamespaceMapping, setQuery
-
-
-
-
Method Detail
-
setDateFormatFrom
public void setDateFormatFrom(String dateFormatFrom)
-
setDateFormatTo
public void setDateFormatTo(String dateFormatTo)
-
contributeMetadata
public Collection<MetadatumDTO> contributeMetadata(org.jdom2.Element element)
Description copied from class:SimpleXpathMetadatumContributorRetrieve the metadata associated with the given object. Depending on the retrieved node (using the query), different types of values will be added to the MetadatumDTO list- Specified by:
contributeMetadatain interfaceMetadataContributor<org.jdom2.Element>- Overrides:
contributeMetadatain classSimpleXpathMetadatumContributor- Parameters:
element- An element to retrieve metadata from.- Returns:
- a collection of import records. Only the identifier of the found records may be put in the record.
-
-