Class SplitMetadataContributor<T>
- java.lang.Object
-
- org.dspace.importer.external.metadatamapping.contributor.SplitMetadataContributor<T>
-
- All Implemented Interfaces:
MetadataContributor<T>
public class SplitMetadataContributor<T> extends Object implements MetadataContributor<T>
Wrapper class used to split another MetadataContributor's output into distinct values. The split is performed by matching a regular expression against the wrapped MetadataContributor's output.- Author:
- Philipp Rumpf (philipp.rumpf@uni-bamberg.de)
-
-
Constructor Summary
Constructors Constructor Description SplitMetadataContributor(MetadataContributor<T> innerContributor, String regex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<MetadatumDTO>contributeMetadata(T t)Each metadatum returned by the wrapped MetadataContributor is split into one or more metadata values based on the provided regular expression.voidsetMetadataFieldMapping(MetadataFieldMapping<T,MetadataContributor<T>> rt)Set the metadataFieldMapping
-
-
-
Constructor Detail
-
SplitMetadataContributor
public SplitMetadataContributor(MetadataContributor<T> innerContributor, String regex)
- Parameters:
innerContributor- The MetadataContributor whose output is splitregex- A regular expression matching the separator between different values
-
-
Method Detail
-
setMetadataFieldMapping
public void setMetadataFieldMapping(MetadataFieldMapping<T,MetadataContributor<T>> rt)
Description copied from interface:MetadataContributorSet the metadataFieldMapping- Specified by:
setMetadataFieldMappingin interfaceMetadataContributor<T>- Parameters:
rt- the MetadataFieldMapping object to set to the MetadataContributor
-
contributeMetadata
public Collection<MetadatumDTO> contributeMetadata(T t)
Each metadatum returned by the wrapped MetadataContributor is split into one or more metadata values based on the provided regular expression.- Specified by:
contributeMetadatain interfaceMetadataContributor<T>- Parameters:
t- The recordType object to retrieve metadata from- Returns:
- The collection of processed metadata values
-
-