Package com.sun.codemodel
Class JAnnotationArrayMember
- java.lang.Object
-
- com.sun.codemodel.JAnnotationValue
-
- com.sun.codemodel.JAnnotationArrayMember
-
- All Implemented Interfaces:
JAnnotatable
,JGenerable
public final class JAnnotationArrayMember extends JAnnotationValue implements JAnnotatable
Represents an arrays as annotation membersThis class implements
JAnnotatable
to allow new annotations to be added as a member of the array.- Author:
- Bhakti Mehta (bhakti.mehta@sun.com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JAnnotationUse
annotate(JClass clazz)
Adds a new annotation to the array.JAnnotationUse
annotate(Class<? extends Annotation> clazz)
Adds a new annotation to the array.<W extends JAnnotationWriter>
Wannotate2(Class<W> clazz)
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.Collection<JAnnotationUse>
annotations()
void
generate(JFormatter f)
JAnnotationArrayMember
param(boolean value)
Adds an array member to this annotationJAnnotationArrayMember
param(byte value)
Adds an array member to this annotationJAnnotationArrayMember
param(char value)
Adds an array member to this annotationJAnnotationArrayMember
param(double value)
Adds an array member to this annotationJAnnotationArrayMember
param(float value)
Adds an array member to this annotationJAnnotationArrayMember
param(int value)
Adds an array member to this annotationJAnnotationArrayMember
param(long value)
Adds an array member to this annotationJAnnotationArrayMember
param(short value)
Adds an array member to this annotationJAnnotationArrayMember
param(JAnnotationUse value)
JAnnotationArrayMember
param(JEnumConstant value)
Adds a enum array member to this annotationJAnnotationArrayMember
param(JExpression value)
Adds an expression array member to this annotationJAnnotationArrayMember
param(JType type)
JAnnotationArrayMember
param(Class<?> value)
Adds a class array member to this annotationJAnnotationArrayMember
param(Enum<?> value)
Adds a enum array member to this annotationJAnnotationArrayMember
param(String value)
Adds an array member to this annotationboolean
removeAnnotation(JAnnotationUse annotation)
Removes annotation from this program element.
-
-
-
Method Detail
-
param
public JAnnotationArrayMember param(String value)
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
public JAnnotationArrayMember param(boolean value)
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
public JAnnotationArrayMember param(byte value)
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
public JAnnotationArrayMember param(char value)
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
public JAnnotationArrayMember param(double value)
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
public JAnnotationArrayMember param(long value)
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
public JAnnotationArrayMember param(short value)
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
public JAnnotationArrayMember param(int value)
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
public JAnnotationArrayMember param(float value)
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
public JAnnotationArrayMember param(Enum<?> value)
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
public JAnnotationArrayMember param(JEnumConstant value)
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
public JAnnotationArrayMember param(JExpression value)
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
public JAnnotationArrayMember param(Class<?> value)
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
public JAnnotationArrayMember param(JType type)
-
annotate
public JAnnotationUse annotate(Class<? extends Annotation> clazz)
Adds a new annotation to the array.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
clazz
- The annotation class to annotate the program element with
-
annotate
public JAnnotationUse annotate(JClass clazz)
Adds a new annotation to the array.- Specified by:
annotate
in interfaceJAnnotatable
- Parameters:
clazz
- The annotation class to annotate the program element with
-
removeAnnotation
public boolean removeAnnotation(JAnnotationUse annotation)
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
public <W extends JAnnotationWriter> W annotate2(Class<W> clazz)
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
public Collection<JAnnotationUse> annotations()
- Specified by:
annotations
in interfaceJAnnotatable
- Returns:
- Can be empty but never null.
-
param
public JAnnotationArrayMember param(JAnnotationUse value)
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
public void generate(JFormatter f)
- Specified by:
generate
in interfaceJGenerable
-
-