接口 MetadataExtractorRegistry
- 所有已知实现类:
DefaultMetadataExtractor
public interface MetadataExtractorRegistry
Stores registrations of extractors for metadata entries. Each metadata entry is decoded based on itsMimeType
and a name is assigned to the decoded value.- 从以下版本开始:
- 5.2
- 作者:
- Rossen Stoyanchev, Brian Clozel
- 另请参阅:
MetadataExtractor
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default void
metadataToExtract(MimeType mimeType, Class<?> targetType, String name)
Decode metadata entries with the givenMimeType
to the specified target class, and store the decoded value in the output map under the given name.<T> void
metadataToExtract(MimeType mimeType, Class<T> targetType, BiConsumer<T,Map<String,Object>> mapper)
Variant ofmetadataToExtract(MimeType, Class, String)
that allows custom logic to be used to map the decoded value to any number of values in the output map.default void
metadataToExtract(MimeType mimeType, ParameterizedTypeReference<?> targetType, String name)
Variant ofmetadataToExtract(MimeType, Class, String)
that acceptsParameterizedTypeReference
instead ofClass
for specifying a target type with generic parameters.<T> void
metadataToExtract(MimeType mimeType, ParameterizedTypeReference<T> type, BiConsumer<T,Map<String,Object>> mapper)
Variant ofmetadataToExtract(MimeType, Class, BiConsumer)
that acceptsParameterizedTypeReference
instead ofClass
for specifying a target type with generic parameters.
方法详细资料
metadataToExtract
default void metadataToExtract(MimeType mimeType, Class<?> targetType, @Nullable String name)
Decode metadata entries with the givenMimeType
to the specified target class, and store the decoded value in the output map under the given name.- 参数:
mimeType
- the mime type of metadata entries to extracttargetType
- the target value type to decode toname
- 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 ofmetadataToExtract(MimeType, Class, String)
that acceptsParameterizedTypeReference
instead ofClass
for specifying a target type with generic parameters.- 参数:
mimeType
- the mime type of metadata entries to extracttargetType
- the target value type to decode to
metadataToExtract
<T> void metadataToExtract(MimeType mimeType, Class<T> targetType, BiConsumer<T,Map<String,Object>> mapper)
Variant ofmetadataToExtract(MimeType, Class, String)
that allows custom logic to be used to map the decoded value to any number of values in the output map.- 类型参数:
T
- the target value type- 参数:
mimeType
- the mime type of metadata entries to extracttargetType
- the target value type to decode tomapper
- 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 ofmetadataToExtract(MimeType, Class, BiConsumer)
that acceptsParameterizedTypeReference
instead ofClass
for specifying a target type with generic parameters.- 类型参数:
T
- the target value type- 参数:
mimeType
- the mime type of metadata entries to extracttype
- the target value type to decode tomapper
- custom logic to add the decoded value to the output map