Class EpoIdMetadataContributor

  • All Implemented Interfaces:
    MetadataContributor<org.jdom2.Element>

    public class EpoIdMetadataContributor
    extends Object
    implements MetadataContributor<org.jdom2.Element>
    Custom MetadataContributor to manage Epo ID. Need as input element and all children.
    Author:
    Pasquale Cavallo
    • Constructor Detail

      • EpoIdMetadataContributor

        public EpoIdMetadataContributor​(String query,
                                        Map<String,​String> prefixToNamespaceMapping,
                                        MetadataFieldConfig field)
        Initialize EpoIdMetadataContributor with a query, prefixToNamespaceMapping and MetadataFieldConfig
        Parameters:
        query - query string
        prefixToNamespaceMapping - metadata prefix to namespace mapping
        field - MetadataFieldConfig
      • EpoIdMetadataContributor

        public EpoIdMetadataContributor()
        Empty constructor for EpoIdMetadataContributor
    • Method Detail

      • setNeedType

        public void setNeedType​(boolean needType)
        This property will be used in ID definition. If this is true, id will be in the form docType:EpoID, otherwise EpoID will be returned
        Parameters:
        needType - if true, docType will be included in id definition
      • getPrefixToNamespaceMapping

        public Map<String,​String> getPrefixToNamespaceMapping()
        Return prefixToNamespaceMapping
        Returns:
        a prefixToNamespaceMapping map
      • getMetadataFieldMapping

        public MetadataFieldMapping<org.jdom2.Element,​MetadataContributor<org.jdom2.Element>> getMetadataFieldMapping()
        Return metadataFieldMapping
        Returns:
        MetadataFieldMapping
      • setPrefixToNamespaceMapping

        public void setPrefixToNamespaceMapping​(Map<String,​String> prefixToNamespaceMapping)
        Set the prefixToNamespaceMapping for this object,
        Parameters:
        prefixToNamespaceMapping - the new mapping.
      • 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
      • getQuery

        public String getQuery()
        Return query used to create an xpathExpression on, this query is used to
        Returns:
        the query this instance is based on
      • setQuery

        public void setQuery​(String query)
      • contributeMetadata

        public Collection<MetadatumDTO> contributeMetadata​(org.jdom2.Element element)
        Retrieve the metadata associated with the given object. Depending on the retrieved node (using the query), different types of values will be added to the MetadatumDTO list
        Specified by:
        contributeMetadata in interface MetadataContributor<org.jdom2.Element>
        Parameters:
        element - 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.