public void releaseInstance(ConstraintValidator<?, ?> constraintValidator) { if (releaseInstanceMethodFound == null) { lazyInit(); } if (Boolean.TRUE.equals(releaseInstanceMethodFound)) { ReflectionUtils.invokeMethod(this.delegate, releaseInstanceMethod, Void.class, true, constraintValidator); } }
private static String createCustomMessage(Exception e, Method method, Object targetObject, Object... arguments) { return e.getMessage() + buildInvokeMethodErrorMessage(method, targetObject, arguments); }
/** * Calculate the hashCode() of a qualifier, which ignores {@link javax.enterprise.util.Nonbinding} members. */ private int getQualifierHashCode(Annotation a) { return ReflectionUtils.calculateHashCodeOfAnnotation(a, true); }
public static boolean isParameterizedTypeWithWildcard(Class<?> type) { if (isParameterizedType(type)) { return containsWildcards(type.getTypeParameters()); } else { return false; } }
for (Field field : ReflectionUtils.getAllDeclaredFields(type)) { AnnotationBuilder annotationBuilder = fields.get(field); if (annotationBuilder == null) { for (Method method : ReflectionUtils.getAllDeclaredMethods(type)) { AnnotationBuilder annotationBuilder = methods.get(method); if (annotationBuilder == null) {
int hashCode = calculateHashCodeOfType(annotationClass); final Object object = invokeMethod(annotation, member, Object.class, true, EMPTY_OBJECT_ARRAY); final int value; if (object.getClass().isArray())
public static boolean isPrimitive(Type type) { Class<?> rawType = getRawType(type); return rawType != null && rawType.isPrimitive(); }
/** * Gets the actual type arguments of a Type * * @param type The type to examine * @return The type arguments */ public static Type[] getActualTypeArguments(Type type) { if (type instanceof Class) { return getActualTypeArguments((Class)type); } throw new IllegalArgumentException((type != null ? type.getClass().getName() : "null") + " isn't supported"); }
String customMessage = createCustomMessage(e, method, instance, args); ExceptionUtils.changeAndThrowException(e, customMessage);
/** * Compute the HashCode. This should be called only in the constructor. */ private int computeHashCode() { int computedHashCode = 31 * ReflectionUtils.calculateHashCodeOfType(type); if (qualifier != null) { computedHashCode = 31 * computedHashCode + getQualifierHashCode(qualifier); } if (qualifiers != null) { for (int i = 0; i < qualifiers.length; i++) { computedHashCode = 31 * computedHashCode + getQualifierHashCode(qualifiers[i]); } } return computedHashCode; }
for (Field field : ReflectionUtils.getAllDeclaredFields(type)) for (Method method : ReflectionUtils.getAllDeclaredMethods(type))
int hashCode = calculateHashCodeOfType(annotationClass); final Object object = invokeMethod(annotation, member, Object.class, true, EMPTY_OBJECT_ARRAY); final int value; if (object.getClass().isArray())
public static boolean isParameterizedTypeWithWildcard(Class<?> type) { if (isParameterizedType(type)) { return containsWildcards(type.getTypeParameters()); } else { return false; } }
public static boolean isPrimitive(Type type) { Class<?> rawType = getRawType(type); return rawType != null && rawType.isPrimitive(); } }
/** * Gets the actual type arguments of a Type * * @param type The type to examine * @return The type arguments */ public static Type[] getActualTypeArguments(Type type) { if (type instanceof Class) { return getActualTypeArguments((Class)type); } throw new IllegalArgumentException((type != null ? type.getClass().getName() : "null") + " isn't supported"); }
String customMessage = createCustomMessage(e, method, instance, args); ExceptionUtils.changeAndThrowException(e, customMessage);
for (Field field : ReflectionUtils.getAllDeclaredFields(type)) for (Method method : ReflectionUtils.getAllDeclaredMethods(type))
public void releaseInstance(ConstraintValidator<?, ?> constraintValidator) { if (releaseInstanceMethodFound == null) { lazyInit(); } if (Boolean.TRUE.equals(releaseInstanceMethodFound)) { ReflectionUtils.invokeMethod(this.delegate, releaseInstanceMethod, Void.class, true, constraintValidator); } }
public static boolean isParameterizedTypeWithWildcard(Class<?> type) { if (isParameterizedType(type)) { return containsWildcards(type.getTypeParameters()); } else { return false; } }
public static boolean isPrimitive(Type type) { Class<?> rawType = getRawType(type); return rawType != null && rawType.isPrimitive(); }