Class SimpleXpathMetadatumContributor

    • Constructor Detail

      • SimpleXpathMetadatumContributor

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

        public SimpleXpathMetadatumContributor()
        Empty constructor for SimpleXpathMetadatumContributor
    • Method Detail

      • 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

        @Autowired(required=true)
        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

        @Autowired(required=true)
        public void setQuery​(String query)
      • contributeMetadata

        public Collection<MetadatumDTO> contributeMetadata​(org.jdom2.Element t)
        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:
        t - An element to retrieve metadata from.
        Returns:
        a collection of import records. Only the identifier of the found records may be put in the record.