private static void setObject(String name, JsonNode node, Object obj, List<Method> mySetters) {
        if (!node.has(TikaJsonSerializer.INSTANTIATED_CLASS_KEY)) {
            setMap(name, node, obj, mySetters);
            return;
        }

        Optional object = deserializeObject(node);
        if (object.isEmpty()) {
            //log, throw exception?!
            return;
        }
        for (Method m : mySetters) {
            Class argClass = m.getParameters()[0].getType();
            if (argClass.isAssignableFrom(object
                    .get()
                    .getClass())) {
                try {
                    m.invoke(obj, object.get());
                    return;
                } catch (IllegalAccessException | InvocationTargetException e) {
                    //swallow
                }
            }
        }
        throw new IllegalArgumentException("can't set object on " + name);
    }
See the notes @link{TikaJsonSerializer}.
<p>
This currently requires a setString() option on objects that have enum parameters.
tika-serialization/src/main/java/org/apache/tika/serialization/TikaJsonDeserializer.java