Package org.apache.tika.serialization
Class TikaJsonSerializer
- java.lang.Object
-
- org.apache.tika.serialization.TikaJsonSerializer
-
public class TikaJsonSerializer extends Object
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
Fields Modifier and Type Field Description static String
INSTANTIATED_CLASS_KEY
static String
SUPER_CLASS_KEY
-
Constructor Summary
Constructors Constructor Description TikaJsonSerializer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
serialize(Object obj, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
static void
serialize(String fieldName, Object obj, Class superClass, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
static void
serializeObject(String fieldName, Object obj, Class superClass, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
-
-
-
Method Detail
-
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, Class superClass, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws TikaSerializationException, IOException
-
serializeObject
public static void serializeObject(String fieldName, Object obj, Class superClass, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws TikaSerializationException
- Parameters:
fieldName
- can be null -- used only for logging and debuggingobj
-superClass
-jsonGenerator
-- Throws:
TikaSerializationException
-
-