Package java.lang.annotation

Examples of java.lang.annotation.Repeatable


    assertNotNull(order);
  }

  @Test
  public void findRepeatableAnnotationOnComposedAnnotation() {
    Repeatable repeatable = findAnnotation(MyRepeatableMeta.class, Repeatable.class);
    assertNotNull(repeatable);
    assertEquals(MyRepeatableContainer.class, repeatable.value());
  }
View Full Code Here


        if (annotation != null) {
            annotations = (T[]) Array.newInstance(annotationClass, 1);
            annotations[0] = annotation;
        } else {
            Repeatable repeatable = annotationClass.getAnnotation(Repeatable.class);
            Annotation container = getDeclaredAnnotation(repeatable.value());

            if (container == null) {
                annotations = (T[]) Array.newInstance(annotationClass, 0);
            } else {
                try {
View Full Code Here

                                Method value = annotationType.getMethod("value");
                                Class returnType = value.getReturnType();

                                if (returnType.isArray()) {
                                    Class<?> componentType = returnType.getComponentType();
                                    Repeatable repeatable = componentType.getAnnotation(Repeatable.class);

                                    if (repeatable != null && repeatable.value() == annotationType) {
                                        value.setAccessible(true);

                                        Annotation[] items = (Annotation[]) value.invoke(annotation);

                                        for (Annotation item : items) {
View Full Code Here

TOP

Related Classes of java.lang.annotation.Repeatable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.