public static boolean hasAnnotation(CtField ctField, String annotation) throws ClassNotFoundException { for (Object object : ctField.getAvailableAnnotations()) { Annotation ann = (Annotation) object; if (ann.annotationType().getName().equals(annotation)) { return true; } } return false; }
/** * Test if a field has the provided annotation * * @param ctField * the javassist field representation * @param annotation * fully qualified name of the annotation class eg."javax.persistence.Entity" * @return true if field has the annotation * @throws java.lang.ClassNotFoundException * if class not found */ protected boolean hasAnnotation(CtField ctField, String annotation) throws ClassNotFoundException { for (Object object : ctField.getAvailableAnnotations()) { Annotation ann = (Annotation) object; if (ann.annotationType().getName().equals(annotation)) { return true; } } return false; }
static Object[] getAnnotationsInternal(Field field) { return getCtField(field).getAvailableAnnotations(); }
static Object[] getDeclaredAnnotationsInternal(Field field) { return getCtField(field).getAvailableAnnotations(); }
for (final Object annotationObject : ctField.getAvailableAnnotations()) { final Annotation annotation = (Annotation) annotationObject; if (ANNOTATIONS.contains(annotation.annotationType())) {
for (CtField field : ctClass.getFields()) { boolean typeProvided = false; Object[] availableAnnotations = field.getAvailableAnnotations(); for (Object annotation : availableAnnotations) { if (annotation instanceof AutoField) {
for (CtField field : ctClass.getFields()) { boolean typeProvided = false; Object[] availableAnnotations = field.getAvailableAnnotations(); for (Object annotation : availableAnnotations) { if (annotation instanceof AutoField) {