Package org.apache.tika.serialization
Class TikaJsonSerializer
java.lang.Object
org.apache.tika.serialization.TikaJsonSerializer
This is a basic serializer that requires that an object:
a) have a no-arg constructor
b) have both setters and getters for the same parameters with the same names, e.g. setXYZ and getXYZ
c) setters and getters have to follow the pattern setX where x is a capital letter
d) have maps as parameters where the keys are strings (and the values are strings for now)
e) at deserialization time, objects that have setters for enums also have to have a setter for a string value of that enum
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
static void
serializeObject
(String fieldName, Object obj, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
-
Field Details
-
INSTANTIATED_CLASS_KEY
-
-
Constructor Details
-
TikaJsonSerializer
public TikaJsonSerializer()
-
-
Method Details
-
serialize
public static void serialize(Object obj, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws TikaSerializationException, IOException -
serialize
public static void serialize(String fieldName, Object obj, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws TikaSerializationException, IOException -
serializeObject
public static void serializeObject(String fieldName, Object obj, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws TikaSerializationException - Parameters:
fieldName
- can be null -- used only for logging and debuggingobj
-jsonGenerator
-- Throws:
TikaSerializationException
-