@Override public boolean matches(CtClass ctClass) { List attributes = ctClass.getClassFile().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { try { CtClass declaringClass = ctClass.getDeclaringClass(); if (declaringClass != null) { attributes = declaringClass.getClassFile().getAttributes(); hasAnnotation = hasAnnotation(attributes); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + ctClass.getName() + "': " + e.getLocalizedMessage(), e); } } return hasAnnotation; }
@Override public boolean matches(CtClass ctClass) { List attributes = ctClass.getClassFile().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { try { CtClass declaringClass = ctClass.getDeclaringClass(); if (declaringClass != null) { attributes = declaringClass.getClassFile().getAttributes(); hasAnnotation = hasAnnotation(attributes); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + ctClass.getName() + "': " + e.getLocalizedMessage(), e); } } return hasAnnotation; }
@Override public boolean matches(CtField ctField) { List attributes = ctField.getFieldInfo().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { CtClass declaringClass = ctField.getDeclaringClass(); hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); if (!hasAnnotation) { try { declaringClass = declaringClass.getDeclaringClass(); if (declaringClass != null) { hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + declaringClass.getName() + "': " + e.getLocalizedMessage(), e); } } } return hasAnnotation; }
@Override public boolean matches(CtBehavior ctBehavior) { List attributes = ctBehavior.getMethodInfo().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { CtClass declaringClass = ctBehavior.getDeclaringClass(); hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); if (!hasAnnotation) { try { declaringClass = declaringClass.getDeclaringClass(); if (declaringClass != null) { hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + declaringClass.getName() + "': " + e.getLocalizedMessage(), e); } } } return hasAnnotation; }
@Override public boolean matches(CtBehavior ctBehavior) { List attributes = ctBehavior.getMethodInfo().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { CtClass declaringClass = ctBehavior.getDeclaringClass(); hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); if (!hasAnnotation) { try { declaringClass = declaringClass.getDeclaringClass(); if (declaringClass != null) { hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + declaringClass.getName() + "': " + e.getLocalizedMessage(), e); } } } return hasAnnotation; }
@Override public boolean matches(CtField ctField) { List attributes = ctField.getFieldInfo().getAttributes(); boolean hasAnnotation = hasAnnotation(attributes); if (!hasAnnotation) { CtClass declaringClass = ctField.getDeclaringClass(); hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); if (!hasAnnotation) { try { declaringClass = declaringClass.getDeclaringClass(); if (declaringClass != null) { hasAnnotation = hasAnnotation(declaringClass.getClassFile().getAttributes()); } } catch (NotFoundException e) { LOGGER.log(Level.FINE, "Failed to load class '" + declaringClass.getName() + "': " + e.getLocalizedMessage(), e); } } } return hasAnnotation; }