Class JsonMetadataSerializer
- java.lang.Object
-
- org.apache.tika.metadata.serialization.JsonMetadataSerializer
-
- All Implemented Interfaces:
com.google.gson.JsonSerializer<Metadata>
public class JsonMetadataSerializer extends Object implements com.google.gson.JsonSerializer<Metadata>
Serializer for Metadata If overriding this, remember that this is called from a static context. Share state only with great caution.
-
-
Constructor Summary
Constructors Constructor Description JsonMetadataSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]
getNames(Metadata metadata)
Override to get a custom sort order or to filter names.com.google.gson.JsonElement
serialize(Metadata metadata, Type type, com.google.gson.JsonSerializationContext context)
Serializes a Metadata object into effectively Map.
-
-
-
Method Detail
-
serialize
public com.google.gson.JsonElement serialize(Metadata metadata, Type type, com.google.gson.JsonSerializationContext context)
Serializes a Metadata object into effectively Map. - Specified by:
serialize
in interfacecom.google.gson.JsonSerializer<Metadata>
- Parameters:
metadata
- object to serializetype
- (ignored)context
- (ignored)- Returns:
- JsonElement with key/value(s) pairs or JsonNull if metadata is null.
-
-