/** * Try to resolve the property type for the supplied methods and target class. The supplied read and write methods * should resemble a Java bean property (setter and getter) * * @param targetClass the target class of the property * @param readMethod the read method of the property * @param writeMethod the write method of the property * @return the actual class of the property type */ public static Class<?> resolvePropertyType(final Class<?> targetClass, final Method readMethod, final Method writeMethod) { Class<?> type = null; if (readMethod != null) { type = resolveReturnType(targetClass, readMethod); } if ((type == null) && (writeMethod != null)) { type = resolveParameterType(targetClass, writeMethod); } return type; }
/** * Try to resolve the property type for the supplied methods and target * class. The supplied read and write methods should resemble a Java bean * property (setter and getter) * * @param targetClass the target class of the property * @param readMethod the read method of the property * @param writeMethod the write method of the property * @return the actual class of the property type */ public static Class<?> resolvePropertyType(final Class<?> targetClass, final Method readMethod, final Method writeMethod) { Class<?> type = null; if (readMethod != null) { type = resolveReturnType(targetClass, readMethod); } if ((type == null) && (writeMethod != null)) { type = resolveParameterType(targetClass, writeMethod); } return type; }