Class SimpleMetadataContributor
java.lang.Object
org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor
- All Implemented Interfaces:
MetadataContributor<PlainMetadataSourceDto>
- Direct Known Subclasses:
EnhancedSimpleMetadataContributor
public class SimpleMetadataContributor
extends Object
implements MetadataContributor<PlainMetadataSourceDto>
Metadata contributor that takes an PlainMetadataSourceDto instance and turns it into a
collection of metadatum
- Author:
- Pasquale Cavallo (pasquale.cavallo at 4science dot it)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the metadata associated with the given object.getField()Method to retrieve theMetadataFieldConfigused in this contributorgetKey()Method to retrieve field itemvoidsetField(MetadataFieldConfig field) Method to inject field itemvoidMethod to inject key valuevoidsetMetadataFieldMapping(MetadataFieldMapping<PlainMetadataSourceDto, MetadataContributor<PlainMetadataSourceDto>> metadataFieldMapping) Set the metadataFieldMapping of this SimpleMetadataContributor
-
Constructor Details
-
SimpleMetadataContributor
-
SimpleMetadataContributor
public SimpleMetadataContributor()
-
-
Method Details
-
setMetadataFieldMapping
public void setMetadataFieldMapping(MetadataFieldMapping<PlainMetadataSourceDto, MetadataContributor<PlainMetadataSourceDto>> metadataFieldMapping) Set the metadataFieldMapping of this SimpleMetadataContributor- Specified by:
setMetadataFieldMappingin interfaceMetadataContributor<PlainMetadataSourceDto>- Parameters:
metadataFieldMapping- the new mapping.
-
contributeMetadata
Retrieve the metadata associated with the given object. It match the key found in PlainMetadataSourceDto instance with the key passed to constructor. In case of success, new metadatum is constructor (using field elements and PlainMetadataSourceDto value) and added to the list.- Specified by:
contributeMetadatain interfaceMetadataContributor<PlainMetadataSourceDto>- Parameters:
t- A class to retrieve metadata and key to match from. t and contained list "metadata" MUST be not null.- Returns:
- a collection of import records. Only the identifier of the found records may be put in the record.
-
setField
Method to inject field item- Parameters:
field- theMetadataFieldConfigto use in this contributor
-
setKey
Method to inject key value -
getKey
Method to retrieve field item -
getField
Method to retrieve theMetadataFieldConfigused in this contributor
-