Home | History | Annotate | Download | only in annotations
      1 
      2 package annotations;
      3 
      4 import java.util.*;
      5 
      6 @ValuesAnnotation(
      7   byteValue = 1,
      8   charValue = 'A',
      9   booleanValue = true,
     10   intValue = 1,
     11   shortValue = 1,
     12   longValue = 1L,
     13   floatValue = 1.0f,
     14   doubleValue = 1.0d,
     15   stringValue = "A",
     16 
     17   enumValue = ValuesEnum.ONE,
     18   annotationValue = @ValueAttrAnnotation( "annotation"),
     19   classValue = Values.class,
     20 
     21   byteArrayValue = { 1, -1},
     22   charArrayValue = { 'c', 'b', (char)-1},
     23   booleanArrayValue = {true, false},
     24   intArrayValue = { 1, -1},
     25   shortArrayValue = { (short)1, (short)-1},
     26   longArrayValue = { 1L, -1L},
     27   floatArrayValue = { 1.0f, -1.0f},
     28   doubleArrayValue = { 1.0d, -1.0d},
     29   stringArrayValue = { "aa", "bb"},
     30 
     31   enumArrayValue = {ValuesEnum.ONE, ValuesEnum.TWO},
     32   annotationArrayValue = {@ValueAttrAnnotation( "annotation1"), @ValueAttrAnnotation( "annotation2")},
     33   classArrayValue = {Values.class, Values.class}
     34 )
     35 @ValueAttrAnnotation1( "classAnnotation1")
     36 @ValueAttrAnnotation2( "classAnnotation2")
     37 public class ExtendedValues {
     38 
     39   @ValueAttrAnnotation1( "fieldAnnotation1")
     40   @ValueAttrAnnotation2( "fieldAnnotation2")
     41   public String testfield = "test";
     42 
     43   public Set<String> testSetOfString;
     44   public Set<Map<String,String>> testSetOfMapOfStringString;
     45 
     46   @SuppressWarnings("unchecked")
     47   @ValueAttrAnnotation1( "methodAnnotation1")
     48   @ValueAttrAnnotation2( "methodAnnotation2")
     49   @ValueAttrAnnotation()
     50   public void testMethod(
     51       @ValueAttrAnnotation1( "param1Annotation1")
     52       @ValueAttrAnnotation2( "param1Annotation2") String param1,
     53       @ValueAttrAnnotation1( "param2Annotation1")
     54       @ValueAttrAnnotation2( "param2Annotation2") int param2) {
     55     // @ValueAttrAnnotation( "codeAnnotation")
     56 
     57     Object o;
     58     Integer testLocalVariable;
     59     Map<String, Set<String>> testLocalMap;
     60 
     61     o = new Object();
     62 
     63     testLocalMap = new HashMap<String, Set<String>>();
     64 
     65     if(o instanceof Map) {
     66 
     67     }
     68 
     69     if(o instanceof Set[][]) {
     70 
     71     }
     72 
     73     testLocalVariable = (Integer) o;
     74     testLocalMap = (HashMap<String, Set<String>>) o;
     75 
     76   }
     77 
     78   public Set<String> testMethod2() {
     79     return null;
     80   }
     81 
     82 }
     83