public static void serialize(String fieldName, Object obj, JsonGenerator jsonGenerator) throws TikaSerializationException, IOException {
        if (obj == null) {
            if (fieldName == null) {
                jsonGenerator.writeNull();
            } else {
                jsonGenerator.writeNullField(fieldName);
            }
        } else if (PRIMITIVES.contains(obj.getClass()) || BOXED.contains(obj.getClass())) {
            try {
                serializePrimitiveAndBoxed(fieldName, obj, jsonGenerator);
            } catch (IOException e) {
                throw new TikaSerializationException("problem serializing", e);
            }
        } else if (isCollection(obj)) {
            serializeCollection(fieldName, obj, jsonGenerator);
        } else if (obj
                .getClass()
                .isEnum()) {
            jsonGenerator.writeStringField(fieldName, ((Enum) obj).name());
        } else {
            serializeObject(fieldName, obj, jsonGenerator);
        }
    }
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
tika-serialization/src/main/java/org/apache/tika/serialization/TikaJsonSerializer.java