private Class retrieveType() throws TikaConfigException {
        Class type;
        if (field != null) {
            type = field.getType();
        } else {
            Class[] params = setter.getParameterTypes();
            if (params.length != 1) {
                String msg = "Invalid setter method. Must have one and only one parameter. ";
                if (setter.getName().startsWith("get")) {
                    msg += "Perhaps the annotation is misplaced on " + setter.getName() +
                            " while a set'X' is expected?";
                }
                throw new TikaConfigException(msg);
            }
            type = params[0];
        }
        if (type.isPrimitive() && PRIMITIVE_MAP.containsKey(type)) {
            type = PRIMITIVE_MAP.get(type); //primitive types have hard time
        }
        return type;
    }
Sets given value to the annotated field of bean

@param bean  bean with annotation for field
@param value value of field
@throws IllegalAccessException    when it occurs
@throws InvocationTargetException when it occurs
tika-core/src/main/java/org/apache/tika/config/ParamField.java