Class PubmedDateMetadatumContributor<T>
java.lang.Object
org.dspace.importer.external.pubmed.metadatamapping.contributor.PubmedDateMetadatumContributor<T>
- All Implemented Interfaces:
MetadataContributor<T>
Pubmed specific implementation of
MetadataContributor
Responsible for generating a set of Date metadata from the retrieved document.- Author:
- Philip Vissenaekens (philip at atmire dot com)
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize an empty PubmedDateMetadatumContributor objectPubmedDateMetadatumContributor(MetadataFieldConfig field, MetadataContributor day, MetadataContributor month, MetadataContributor year) -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the metadata associated with the given object.getDay()Retrieve the day from the objectgetField()Return the MetadataFieldConfig used while retrieving MetadatumDTOgetMonth()Retrieve the month from the objectgetYear()Retrieve the year from the objectvoidsetDateFormatsToAttempt(List<String> dateFormatsToAttempt) voidSet a day (MetadataContributor) to this objectvoidsetField(MetadataFieldConfig field) Setting the MetadataFieldConfigvoidsetMetadataFieldMapping(MetadataFieldMapping<T, MetadataContributor<T>> metadataFieldMapping) Set the metadatafieldMapping used in the transforming of a record to actual metadata.voidsetMonth(MetadataContributor month) Set a month (MetadataContributor) to this objectvoidsetYear(MetadataContributor year) Set a year (MetadataContributor) to this object
-
Constructor Details
-
PubmedDateMetadatumContributor
public PubmedDateMetadatumContributor()Initialize an empty PubmedDateMetadatumContributor object -
PubmedDateMetadatumContributor
public PubmedDateMetadatumContributor(MetadataFieldConfig field, MetadataContributor day, MetadataContributor month, MetadataContributor year) - Parameters:
field-MetadataFieldConfigused in mappingday- a MetadataContributor, representing a daymonth- aMetadataContributor, representing a monthyear- aMetadataContributor, representing a year
-
-
Method Details
-
getDateFormatsToAttempt
-
setDateFormatsToAttempt
-
setMetadataFieldMapping
public void setMetadataFieldMapping(MetadataFieldMapping<T, MetadataContributor<T>> metadataFieldMapping) Set the metadatafieldMapping used in the transforming of a record to actual metadata.- Specified by:
setMetadataFieldMappingin interfaceMetadataContributor<T>- Parameters:
metadataFieldMapping- the new mapping.
-
contributeMetadata
Retrieve the metadata associated with the given object. The code will loop over the different dates and attempt to format them using the configured dateFormats to attempt. For each date, once a format is successful, this result is used. Make sure that dateFormatsToAttempt is configured from most restrictive to most lenient to try and get the most precise result- Specified by:
contributeMetadatain interfaceMetadataContributor<T>- Parameters:
t- A class to retrieve metadata from.- Returns:
- a collection of import records. Only the identifier of the found records may be put in the record.
-
getField
Return the MetadataFieldConfig used while retrieving MetadatumDTO- Returns:
- MetadataFieldConfig
-
setField
Setting the MetadataFieldConfig- Parameters:
field- MetadataFieldConfig used while retrieving MetadatumDTO
-
getDay
Retrieve the day from the object- Returns:
MetadataContributor, representing a day
-
setDay
Set a day (MetadataContributor) to this object- Parameters:
day- aMetadataContributor, representing a day
-
getMonth
Retrieve the month from the object- Returns:
MetadataContributor, representing a month
-
setMonth
Set a month (MetadataContributor) to this object- Parameters:
month- aMetadataContributor, representing a month
-
getYear
Retrieve the year from the object- Returns:
MetadataContributor, representing a year
-
setYear
Set a year (MetadataContributor) to this object- Parameters:
year- aMetadataContributor, representing a year
-