private static void getListeners(XClass currentClazz, List<Class> orderedListeners) { EntityListeners entityListeners = currentClazz.getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0; index-- ) { orderedListeners.add( classes[index] ); } } if ( useAnnotationAnnotatedByListener ) { Annotation[] annotations = currentClazz.getAnnotations(); for ( Annotation annot : annotations ) { entityListeners = annot.getClass().getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0; index-- ) { orderedListeners.add( classes[index] ); } } } } } }
@Override public Annotation[] getAnnotations() { return delegate.getAnnotations(); }
private static void getListeners(XClass currentClazz, List<Class> orderedListeners) { EntityListeners entityListeners = currentClazz.getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0 ; index-- ) { orderedListeners.add( classes[index] ); } } if ( useAnnotationAnnotatedByListener ) { Annotation[] annotations = currentClazz.getAnnotations(); for ( Annotation annot : annotations ) { entityListeners = annot.getClass().getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0 ; index-- ) { orderedListeners.add( classes[index] ); } } } } } }
private static void getListeners(XClass currentClazz, List<Class> orderedListeners) { EntityListeners entityListeners = (EntityListeners) currentClazz.getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0 ; index-- ) { orderedListeners.add( classes[index] ); } } if ( useAnnotationAnnotatedByListener ) { Annotation[] annotations = currentClazz.getAnnotations(); for ( Annotation annot : annotations ) { entityListeners = annot.getClass().getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0 ; index-- ) { orderedListeners.add( classes[index] ); } } } } } }
private static void getListeners(XClass currentClazz, List<Class> orderedListeners) { EntityListeners entityListeners = currentClazz.getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0; index-- ) { orderedListeners.add( classes[index] ); } } if ( useAnnotationAnnotatedByListener ) { Annotation[] annotations = currentClazz.getAnnotations(); for ( Annotation annot : annotations ) { entityListeners = annot.getClass().getAnnotation( EntityListeners.class ); if ( entityListeners != null ) { Class[] classes = entityListeners.value(); int size = classes.length; for ( int index = size - 1; index >= 0; index-- ) { orderedListeners.add( classes[index] ); } } } } } }
addSuperClassesAndInterfaces( xClass, classes ); for ( XClass currentClass : classes ) { Annotation[] classAnnotations = currentClass.getAnnotations(); for ( int i = 0; i < classAnnotations.length ; i++ ) { Annotation classAnnotation = classAnnotations[i];
/** * Checks whether the specified class contains any locally-declared, Search-specific annotations. * * <p>This method will return {@code true} if such an annotation is detected * in the class itself, either applied directly on the class, on a field, or on a method. * <p>Only fields and methods declared by the specified class are taken into account: * inherited fields and methods are ignored. * * @param mappedClass the {@code XClass} to check for Search annotations * * @return Returns {@code true} if the class contains at least one Search annotation, {@code false} otherwise */ private static boolean containsLocalSearchAnnotation(XClass mappedClass) { // check the type annotations if ( containsSearchAnnotation( mappedClass.getAnnotations() ) ) { return true; } for ( XProperty method : mappedClass.getDeclaredProperties( XClass.ACCESS_PROPERTY ) ) { if ( containsSearchAnnotation( method.getAnnotations() ) ) { return true; } } for ( XProperty field : mappedClass.getDeclaredProperties( XClass.ACCESS_FIELD ) ) { if ( containsSearchAnnotation( field.getAnnotations() ) ) { return true; } } return false; }
/** * Checks whether the specified class contains any locally-declared, Search-specific annotations. * * <p>This method will return {@code true} if such an annotation is detected * in the class itself, either applied directly on the class, on a field, or on a method. * <p>Only fields and methods declared by the specified class are taken into account: * inherited fields and methods are ignored. * * @param mappedClass the {@code XClass} to check for Search annotations * * @return Returns {@code true} if the class contains at least one Search annotation, {@code false} otherwise */ private static boolean containsLocalSearchAnnotation(XClass mappedClass) { // check the type annotations if ( containsSearchAnnotation( mappedClass.getAnnotations() ) ) { return true; } for ( XProperty method : mappedClass.getDeclaredProperties( XClass.ACCESS_PROPERTY ) ) { if ( containsSearchAnnotation( method.getAnnotations() ) ) { return true; } } for ( XProperty field : mappedClass.getDeclaredProperties( XClass.ACCESS_FIELD ) ) { if ( containsSearchAnnotation( field.getAnnotations() ) ) { return true; } } return false; }