@@ -44,23 +44,29 @@ class Annotation extends @annotation, Expr {
44
44
result = this .getType ( ) .getAnnotationElement ( name )
45
45
}
46
46
47
- /** Gets a value of an annotation element. */
47
+ /**
48
+ * Gets a value of an annotation element. This includes default values in case
49
+ * no explicit value is specified.
50
+ */
48
51
Expr getAValue ( ) { filteredAnnotValue ( this , _, result ) }
49
52
50
- /** Gets the value of the annotation element with the specified `name`. */
53
+ /**
54
+ * Gets the value of the annotation element with the specified `name`.
55
+ * This includes default values in case no explicit value is specified.
56
+ */
51
57
Expr getValue ( string name ) { filteredAnnotValue ( this , this .getAnnotationElement ( name ) , result ) }
52
58
53
59
/**
54
60
* If the value type of the annotation element with the specified `name` is an enum type,
55
- * gets the enum constant used as value for that element.
61
+ * gets the enum constant used as value for that element. This includes default values in
62
+ * case no explicit value is specified.
56
63
*/
57
- EnumConstant getValueEnumConstant ( string name ) {
58
- result = getValue ( name ) .( FieldRead ) .getField ( )
59
- }
64
+ EnumConstant getValueEnumConstant ( string name ) { result = getValue ( name ) .( FieldRead ) .getField ( ) }
60
65
61
66
/**
62
67
* If the value type of the annotation element with the specified `name` is `String`,
63
- * gets the string value used for that element.
68
+ * gets the string value used for that element. This includes default values in case no
69
+ * explicit value is specified.
64
70
*/
65
71
string getValueString ( string name ) {
66
72
// Uses CompileTimeConstantExpr instead of StringLiteral because value can
@@ -70,7 +76,8 @@ class Annotation extends @annotation, Expr {
70
76
71
77
/**
72
78
* If the value type of the annotation element with the specified `name` is `int`,
73
- * gets the int value used for that element.
79
+ * gets the int value used for that element. This includes default values in case no
80
+ * explicit value is specified.
74
81
*/
75
82
int getValueInt ( string name ) {
76
83
// Uses CompileTimeConstantExpr instead of IntegerLiteral because value can
@@ -80,7 +87,8 @@ class Annotation extends @annotation, Expr {
80
87
81
88
/**
82
89
* If the value type of the annotation element with the specified `name` is `boolean`,
83
- * gets the boolean value used for that element.
90
+ * gets the boolean value used for that element. This includes default values in case
91
+ * no explicit value is specified.
84
92
*/
85
93
boolean getValueBoolean ( string name ) {
86
94
// Uses CompileTimeConstantExpr instead of BooleanLiteral because value can
@@ -90,7 +98,8 @@ class Annotation extends @annotation, Expr {
90
98
91
99
/**
92
100
* If the annotation element with the specified `name` has a Java `Class` as value type,
93
- * gets the referenced type used as value for that element.
101
+ * gets the referenced type used as value for that element. This includes default values
102
+ * in case no explicit value is specified.
94
103
*/
95
104
Type getValueClass ( string name ) { result = getValue ( name ) .( TypeLiteral ) .getReferencedType ( ) }
96
105
@@ -104,7 +113,7 @@ class Annotation extends @annotation, Expr {
104
113
105
114
/**
106
115
* Gets a value of the annotation element with the specified `name`, which must be declared as an array
107
- * type.
116
+ * type. This includes default values in case no explicit value is specified.
108
117
*
109
118
* If the annotation element is defined with an array initializer, then the returned value will
110
119
* be one of the elements of that array. Otherwise, the returned value will be the single
@@ -114,7 +123,7 @@ class Annotation extends @annotation, Expr {
114
123
115
124
/**
116
125
* Gets the value at a given index of the annotation element with the specified `name`, which must be
117
- * declared as an array type.
126
+ * declared as an array type. This includes default values in case no explicit value is specified.
118
127
*
119
128
* If the annotation element is defined with an array initializer, then the returned value will
120
129
* be the elements at the given index of that array. Otherwise, if the index is 0 the returned value
0 commit comments