Refine search
private static boolean isInterfaceExtending(Class<?> interfaceClass, Class<?> superinterface) { if (interfaceClass.equals(superinterface)) { return false; } else if (superinterface == null) { return interfaceClass.getInterfaces().length == 0; } else { return Arrays2.contains(interfaceClass.getInterfaces(), superinterface); } } }
public static boolean unorderedEquals(Object[] array, Object... values) { return containsAll(array, values) && array.length == values.length; }
private static boolean isValidTargetType(EnhancedAnnotation<?> annotation) { Target target = annotation.getAnnotation(Target.class); return target != null && (Arrays2.unorderedEquals(target.value(), ElementType.TYPE, ElementType.METHOD) || Arrays2.unorderedEquals(target.value(), ElementType.TYPE)); }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation); } } }
/** * Validates the members */ protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldParameterType(annotatedAnnotation); } } }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else { ElementType[] elementTypes = annotatedAnnotation.getAnnotation(Target.class).value(); if (!(Arrays2.unorderedEquals(elementTypes, METHOD, FIELD, TYPE) || Arrays2.unorderedEquals(elementTypes, TYPE) || Arrays2.unorderedEquals(elementTypes, METHOD) || Arrays2.unorderedEquals(elementTypes, FIELD) || Arrays2.unorderedEquals(elementTypes, METHOD, TYPE) )) { ReflectionLogger.LOG.missingTargetMethodFieldTypeParameterOrTargetMethodTypeOrTargetMethodOrTargetTypeOrTargetField(annotatedAnnotation); } } } }
private void checkMetaAnnotations(EnhancedAnnotation<T> annotatedAnnotation) { ElementType[] elementTypes = getTargetElementTypes(annotatedAnnotation.getAnnotation(Target.class)); for (Annotation inheritedBinding : getInheritedInterceptionBindingTypes()) { ElementType[] metaAnnotationElementTypes = getTargetElementTypes(inheritedBinding.annotationType().getAnnotation(Target.class)); if (!Arrays2.containsAll(metaAnnotationElementTypes, elementTypes)) { ReflectionLogger.LOG.invalidInterceptorBindingTargetDeclaration(inheritedBinding.annotationType().getName(), Arrays.toString(metaAnnotationElementTypes), annotatedAnnotation.getJavaClass().getName(), Arrays.toString(elementTypes)); } } }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation); } } }
/** * Validates the members */ protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldParameterType(annotatedAnnotation); } } }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else { ElementType[] elementTypes = annotatedAnnotation.getAnnotation(Target.class).value(); if (!(Arrays2.unorderedEquals(elementTypes, METHOD, FIELD, TYPE) || Arrays2.unorderedEquals(elementTypes, TYPE) || Arrays2.unorderedEquals(elementTypes, METHOD) || Arrays2.unorderedEquals(elementTypes, FIELD) || Arrays2.unorderedEquals(elementTypes, METHOD, TYPE) )) { ReflectionLogger.LOG.missingTargetMethodFieldTypeParameterOrTargetMethodTypeOrTargetMethodOrTargetTypeOrTargetField(annotatedAnnotation); } } } }
private void checkMetaAnnotations(EnhancedAnnotation<T> annotatedAnnotation) { ElementType[] elementTypes = getTargetElementTypes(annotatedAnnotation.getAnnotation(Target.class)); for (Annotation inheritedBinding : getInheritedInterceptionBindingTypes()) { ElementType[] metaAnnotationElementTypes = getTargetElementTypes(inheritedBinding.annotationType().getAnnotation(Target.class)); if (!Arrays2.containsAll(metaAnnotationElementTypes, elementTypes)) { ReflectionLogger.LOG.invalidInterceptorBindingTargetDeclaration(inheritedBinding.annotationType().getName(), Arrays.toString(metaAnnotationElementTypes), annotatedAnnotation.getJavaClass().getName(), Arrays.toString(elementTypes)); } } }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation); } } }
/** * Validates the members */ protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldParameterType(annotatedAnnotation); } } }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else { ElementType[] elementTypes = annotatedAnnotation.getAnnotation(Target.class).value(); if (!(Arrays2.unorderedEquals(elementTypes, METHOD, FIELD, TYPE) || Arrays2.unorderedEquals(elementTypes, TYPE) || Arrays2.unorderedEquals(elementTypes, METHOD) || Arrays2.unorderedEquals(elementTypes, FIELD) || Arrays2.unorderedEquals(elementTypes, METHOD, TYPE) )) { ReflectionLogger.LOG.missingTargetMethodFieldTypeParameterOrTargetMethodTypeOrTargetMethodOrTargetTypeOrTargetField(annotatedAnnotation); } } } }
private void checkMetaAnnotations(EnhancedAnnotation<T> annotatedAnnotation) { ElementType[] elementTypes = getTargetElementTypes(annotatedAnnotation.getAnnotation(Target.class)); for (Annotation inheritedBinding : getInheritedInterceptionBindingTypes()) { ElementType[] metaAnnotationElementTypes = getTargetElementTypes(inheritedBinding.annotationType().getAnnotation(Target.class)); if (!Arrays2.containsAll(metaAnnotationElementTypes, elementTypes)) { ReflectionLogger.LOG.invalidInterceptorBindingTargetDeclaration(inheritedBinding.annotationType().getName(), Arrays.toString(metaAnnotationElementTypes), annotatedAnnotation.getJavaClass().getName(), Arrays.toString(elementTypes)); } } }
private static boolean isValidTargetType(EnhancedAnnotation<?> annotation) { Target target = annotation.getAnnotation(Target.class); return target != null && (Arrays2.unorderedEquals(target.value(), ElementType.TYPE, ElementType.METHOD) || Arrays2.unorderedEquals(target.value(), ElementType.TYPE)); }
private static boolean isInterfaceExtending(Class<?> interfaceClass, Class<?> superinterface) { if (interfaceClass.equals(superinterface)) { return false; } else if (superinterface == null) { return interfaceClass.getInterfaces().length == 0; } else { return Arrays2.contains(interfaceClass.getInterfaces(), superinterface); } } }
public static boolean unorderedEquals(Object[] array, Object... values) { return containsAll(array, values) && array.length == values.length; }
@Override protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldType(annotatedAnnotation); } } }
/** * Validates the members */ protected void check(EnhancedAnnotation<T> annotatedAnnotation) { super.check(annotatedAnnotation); if (isValid()) { if (!annotatedAnnotation.isAnnotationPresent(Target.class)) { ReflectionLogger.LOG.missingTarget(annotatedAnnotation); } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE)) { ReflectionLogger.LOG.missingTargetMethodFieldParameterType(annotatedAnnotation); } } }