Class MultipleMetadataContributor<T>
java.lang.Object
org.dspace.importer.external.metadatamapping.contributor.MultipleMetadataContributor<T>
- All Implemented Interfaces:
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<RecordType>
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructorMultipleMetadataContributor(MetadataFieldConfig field, List<MetadataContributor> metadatumContributors) -
Method Summary
Modifier and TypeMethodDescriptiona 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.getField()Return the MetadataFieldConfig used while retrieving MetadatumDTOReturn 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 Details
-
MultipleMetadataContributor
public MultipleMetadataContributor()Empty constructor -
MultipleMetadataContributor
public MultipleMetadataContributor(MetadataFieldConfig field, List<MetadataContributor> metadatumContributors) - Parameters:
field-MetadataFieldConfigused in mappingmetadatumContributors- A list of MetadataContributor
-
-
Method Details
-
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
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
Return the MetadataFieldConfig used while retrieving MetadatumDTO- Returns:
- MetadataFieldConfig
-
setField
Setting the MetadataFieldConfig- Parameters:
field- MetadataFieldConfig used while retrieving MetadatumDTO
-
getMetadatumContributors
Return the List of MetadataContributor objects set to this class- Returns:
- metadatumContributors, list of MetadataContributor
-
setMetadatumContributors
Set the List of MetadataContributor objects set to this class- Parameters:
metadatumContributors- A list of MetadatumContributor classes
-