Interface MetadataExtractorRegistry

All Known Implementing Classes:
DefaultMetadataExtractor

public interface MetadataExtractorRegistry
Stores registrations of extractors for metadata entries. Each metadata entry is decoded based on its MimeType and a name is assigned to the decoded value.
Since:
5.2
Author:
Rossen Stoyanchev, Brian Clozel
See Also:
  • Method Details

    • metadataToExtract

      default void metadataToExtract(MimeType mimeType, Class<?> targetType, @Nullable String name)
      Decode metadata entries with the given MimeType to the specified target class, and store the decoded value in the output map under the given name.
      Parameters:
      mimeType - the mime type of metadata entries to extract
      targetType - the target value type to decode to
      name - assign a name for the decoded value; if not provided, then the mime type is used as the key
    • metadataToExtract

      default void metadataToExtract(MimeType mimeType, ParameterizedTypeReference<?> targetType, @Nullable String name)
      Variant of metadataToExtract(MimeType, Class, String) that accepts ParameterizedTypeReference instead of Class for specifying a target type with generic parameters.
      Parameters:
      mimeType - the mime type of metadata entries to extract
      targetType - the target value type to decode to
    • metadataToExtract

      <T> void metadataToExtract(MimeType mimeType, Class<T> targetType, BiConsumer<T,Map<String,Object>> mapper)
      Variant of metadataToExtract(MimeType, Class, String) that allows custom logic to be used to map the decoded value to any number of values in the output map.
      Type Parameters:
      T - the target value type
      Parameters:
      mimeType - the mime type of metadata entries to extract
      targetType - the target value type to decode to
      mapper - custom logic to add the decoded value to the output map
    • metadataToExtract

      <T> void metadataToExtract(MimeType mimeType, ParameterizedTypeReference<T> type, BiConsumer<T,Map<String,Object>> mapper)
      Variant of metadataToExtract(MimeType, Class, BiConsumer) that accepts ParameterizedTypeReference instead of Class for specifying a target type with generic parameters.
      Type Parameters:
      T - the target value type
      Parameters:
      mimeType - the mime type of metadata entries to extract
      type - the target value type to decode to
      mapper - custom logic to add the decoded value to the output map