View Javadoc
1   /*
2   AnnotationLocation
3   allowSamelineMultipleAnnotations = (default)false
4   allowSamelineSingleParameterlessAnnotation = (default)true
5   allowSamelineParameterizedAnnotation = (default)false
6   tokens = ANNOTATION_DEF, ANNOTATION_FIELD_DEF
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation;
12  
13  import java.lang.annotation.ElementType;
14  import java.lang.annotation.Repeatable;
15  import java.lang.annotation.Target;
16  
17  @AnnotationAnnotation(value = "foo")
18    @AnnotationAnnotation // violation '.* incorrect .* level 2, .* should be 0.'
19  // violation below 'Annotation 'AnnotationAnnotation' should be alone on line.'
20  @AnnotationAnnotation("bar") @interface InputAnnotationLocationAnnotation {
21  
22      @AnnotationAnnotation(value = "foo")
23        @AnnotationAnnotation // violation '.* incorrect .* level 6, .* should be 4.'
24      @AnnotationAnnotation("bar") String value(); // violation '.* should be alone on line.'
25  
26  }
27  
28  @Repeatable(AnnotationAnnotations.class)
29  @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
30  @interface AnnotationAnnotation  {
31  
32      String value() default "";
33  
34  }
35  
36  @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
37  @interface AnnotationAnnotations {
38  
39      AnnotationAnnotation[] value();
40  
41  }