: xProperty.getAnnotations();
/** * Returns the value generation strategy for the given property, if any. */ private ValueGeneration getValueGenerationFromAnnotations(XProperty property) { AnnotationValueGeneration<?> valueGeneration = null; for ( Annotation annotation : property.getAnnotations() ) { AnnotationValueGeneration<?> candidate = getValueGenerationFromAnnotation( property, annotation ); if ( candidate != null ) { if ( valueGeneration != null ) { throw new AnnotationException( "Only one generator annotation is allowed:" + StringHelper.qualify( holder.getPath(), name ) ); } else { valueGeneration = candidate; } } } return valueGeneration; }
/** * 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; }
/** * Returns the value generation strategy for the given property, if any. */ private ValueGeneration getValueGenerationFromAnnotations(XProperty property) { AnnotationValueGeneration<?> valueGeneration = null; for ( Annotation annotation : property.getAnnotations() ) { AnnotationValueGeneration<?> candidate = getValueGenerationFromAnnotation( property, annotation ); if ( candidate != null ) { if ( valueGeneration != null ) { throw new AnnotationException( "Only one generator annotation is allowed:" + StringHelper.qualify( holder.getPath(), name ) ); } else { valueGeneration = candidate; } } } return valueGeneration; }