Class PubmedDateMetadatumContributor<T>
- java.lang.Object
-
- org.dspace.importer.external.pubmed.metadatamapping.contributor.PubmedDateMetadatumContributor<T>
-
- All Implemented Interfaces:
MetadataContributor<T>
public class PubmedDateMetadatumContributor<T> extends Object implements MetadataContributor<T>
Pubmed specific implementation ofMetadataContributorResponsible for generating a set of Date metadata from the retrieved document.- Author:
- Philip Vissenaekens (philip at atmire dot com)
-
-
Constructor Summary
Constructors Constructor Description PubmedDateMetadatumContributor()Initialize an empty PubmedDateMetadatumContributor objectPubmedDateMetadatumContributor(MetadataFieldConfig field, MetadataContributor day, MetadataContributor month, MetadataContributor year)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<MetadatumDTO>contributeMetadata(T t)Retrieve the metadata associated with the given object.List<String>getDateFormatsToAttempt()MetadataContributorgetDay()Retrieve the day from the objectMetadataFieldConfiggetField()Return the MetadataFieldConfig used while retrieving MetadatumDTOMetadataContributorgetMonth()Retrieve the month from the objectMetadataContributorgetYear()Retrieve the year from the objectvoidsetDateFormatsToAttempt(List<String> dateFormatsToAttempt)voidsetDay(MetadataContributor day)Set 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 Detail
-
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 Detail
-
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
public Collection<MetadatumDTO> contributeMetadata(T t)
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
public MetadataFieldConfig getField()
Return the MetadataFieldConfig used while retrieving MetadatumDTO- Returns:
- MetadataFieldConfig
-
setField
public void setField(MetadataFieldConfig field)
Setting the MetadataFieldConfig- Parameters:
field- MetadataFieldConfig used while retrieving MetadatumDTO
-
getDay
public MetadataContributor getDay()
Retrieve the day from the object- Returns:
MetadataContributor, representing a day
-
setDay
public void setDay(MetadataContributor day)
Set a day (MetadataContributor) to this object- Parameters:
day- aMetadataContributor, representing a day
-
getMonth
public MetadataContributor getMonth()
Retrieve the month from the object- Returns:
MetadataContributor, representing a month
-
setMonth
public void setMonth(MetadataContributor month)
Set a month (MetadataContributor) to this object- Parameters:
month- aMetadataContributor, representing a month
-
getYear
public MetadataContributor getYear()
Retrieve the year from the object- Returns:
MetadataContributor, representing a year
-
setYear
public void setYear(MetadataContributor year)
Set a year (MetadataContributor) to this object- Parameters:
year- aMetadataContributor, representing a year
-
-