Class MultipleMetadataContributor<T>
- java.lang.Object
-
- org.dspace.importer.external.metadatamapping.contributor.MultipleMetadataContributor<T>
-
- All Implemented Interfaces:
MetadataContributor<T>
public class MultipleMetadataContributor<T> extends Object implements MetadataContributor<T>
This Contributor is helpful to avoid the limit of the Live Import Framework. In Live Import, one dc schema/element/qualifier could be associate with one and only one MetadataContributor, because the map they're saved in use dc entity as key. In fact, in this implementation we use the MetadataFieldConfig present in this MultipleMetadataContributor contributor, but the data (values of the dc metadatum) will be loaded using any of the contributor defined in the List metadatumContributors, by iterating over them.- Author:
- Pasquale Cavallo (pasquale.cavallo at 4science dot it)
- See Also:
org.dspace.importer.external.metadatamapping.AbstractMetadataFieldMapping
-
-
Constructor Summary
Constructors Constructor Description MultipleMetadataContributor()Empty constructorMultipleMetadataContributor(MetadataFieldConfig field, List<MetadataContributor> metadatumContributors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<MetadatumDTO>contributeMetadata(T t)a separate Metadatum object is created for each index of Metadatum returned from the calls to MetadatumContributor.contributeMetadata(t) for each MetadatumContributor in the metadatumContributors list.MetadataFieldConfiggetField()Return the MetadataFieldConfig used while retrieving MetadatumDTOList<MetadataContributor>getMetadatumContributors()Return the List of MetadataContributor objects set to this classvoidsetField(MetadataFieldConfig field)Setting the MetadataFieldConfigvoidsetMetadataFieldMapping(MetadataFieldMapping<T,MetadataContributor<T>> metadataFieldMapping)Set the metadatafieldMapping used in the transforming of a record to actual metadatavoidsetMetadatumContributors(List<MetadataContributor> metadatumContributors)Set the List of MetadataContributor objects set to this class
-
-
-
Constructor Detail
-
MultipleMetadataContributor
public MultipleMetadataContributor()
Empty constructor
-
MultipleMetadataContributor
public MultipleMetadataContributor(MetadataFieldConfig field, List<MetadataContributor> metadatumContributors)
- Parameters:
field-MetadataFieldConfigused in mappingmetadatumContributors- A list of MetadataContributor
-
-
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)
a separate Metadatum object is created for each index of Metadatum returned from the calls to MetadatumContributor.contributeMetadata(t) for each MetadatumContributor in the metadatumContributors list. All of them have as dc schema/element/qualifier the values defined in MetadataFieldConfig.- Specified by:
contributeMetadatain interfaceMetadataContributor<T>- Parameters:
t- the object we are trying to translate- Returns:
- a collection of metadata got from each MetadataContributor
-
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
-
getMetadatumContributors
public List<MetadataContributor> getMetadatumContributors()
Return the List of MetadataContributor objects set to this class- Returns:
- metadatumContributors, list of MetadataContributor
-
setMetadatumContributors
public void setMetadatumContributors(List<MetadataContributor> metadatumContributors)
Set the List of MetadataContributor objects set to this class- Parameters:
metadatumContributors- A list of MetadatumContributor classes
-
-