Interface MetadataExtracter

    • Method Detail

      • isSupported

        boolean isSupported​(String mimetype)
        Determines if the extracter works against the given mimetype.
        Parameters:
        mimetype - the document mimetype
        Returns:
        Returns true if the mimetype is supported, otherwise false.
      • extract

        Map<QName,​Serializable> extract​(ContentReader reader,
                                              MetadataExtracter.OverwritePolicy overwritePolicy,
                                              Map<QName,​Serializable> destination,
                                              Map<String,​Set<QName>> mapping)
        Extracts the metadata from the content provided by the reader and source mimetype to the supplied map. The mapping from document metadata to system metadata is explicitly provided. The overwrite policy is also explictly set.

        The extraction viability can be determined by an up front call to isSupported(String).

        The source mimetype must be available on the ContentAccessor.getMimetype() method of the reader.

        Parameters:
        reader - the source of the content
        overwritePolicy - the policy stipulating how the system properties must be overwritten if present
        destination - the map of properties to populate (essentially a return value)
        mapping - a mapping of document-specific properties to system properties.
        Returns:
        Returns a map of all properties on the destination map that were added or modified. If the return map is empty, then no properties were modified.
        Throws:
        ContentIOException - if a detectable error occurs
        See Also:
        extract(ContentReader, Map)