Package com.sun.codemodel
Class JAnnotationArrayMember
java.lang.Object
com.sun.codemodel.JAnnotationValue
com.sun.codemodel.JAnnotationArrayMember
- All Implemented Interfaces:
JAnnotatable
,JGenerable
Represents an arrays as annotation members
This class implements JAnnotatable
to allow
new annotations to be added as a member of the array.
- Author:
- Bhakti Mehta ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new annotation to the array.annotate
(Class<? extends Annotation> clazz) Adds a new annotation to the array.<W extends JAnnotationWriter<? extends Annotation>>
WAdds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.Read-only live view of all annotations on thisvoid
param
(boolean value) Adds an array member to this annotationparam
(byte value) Adds an array member to this annotationparam
(char value) Adds an array member to this annotationparam
(double value) Adds an array member to this annotationparam
(float value) Adds an array member to this annotationparam
(int value) Adds an array member to this annotationparam
(long value) Adds an array member to this annotationparam
(short value) Adds an array member to this annotationparam
(JAnnotationUse value) Deprecated, for removal: This API element is subject to removal in a future version.param
(JEnumConstant value) Adds a enum array member to this annotationparam
(JExpression value) Adds an expression array member to this annotationAdds a class array member to this annotationAdds a enum array member to this annotationAdds an array member to this annotationboolean
removeAnnotation
(JAnnotationUse annotation) Removes annotation from this program element.
-
Method Details
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a string value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a boolean value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a byte value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a char value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a double value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a long value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a short value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds an int value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an array member to this annotation- Parameters:
value
- Adds a float value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds a enum array member to this annotation- Parameters:
value
- Adds a enum value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds a enum array member to this annotation- Parameters:
value
- Adds a enum value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds an expression array member to this annotation- Parameters:
value
- Adds an expression value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
Adds a class array member to this annotation- Parameters:
value
- Adds a class value to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
param
-
annotate
Adds a new annotation to the array.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
clazz
- The annotation class to annotate the program element with
-
annotate
Adds a new annotation to the array.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
clazz
- The annotation class to annotate the program element with
-
removeAnnotation
Description copied from interface:JAnnotatable
Removes annotation from this program element.- Specified by:
removeAnnotation
in interfaceJAnnotatable
- Parameters:
annotation
- The annotation to be removed from the program element
-
annotate2
Description copied from interface:JAnnotatable
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.- Specified by:
annotate2
in interfaceJAnnotatable
-
annotations
Description copied from interface:JAnnotatable
Read-only live view of all annotations on this- Specified by:
annotations
in interfaceJAnnotatable
- Returns:
- Can be empty but never null.
-
annotations2
-
param
Deprecated, for removal: This API element is subject to removal in a future version.Adds an annotation member to this annotation array This can be used for e.g @XmlCollection(values= @XmlCollectionItem(type=Foo.class))- Parameters:
value
- Adds a annotation to the array member- Returns:
- The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
-
generate
- Specified by:
generate
in interfaceJGenerable
-
annotate(java.lang.Class<? extends java.lang.annotation.Annotation>)