Top Description Fields Constructors Methods
com.sun.codemodel

public final Class JAnnotationArrayMember

extends JAnnotationValue
implements JAnnotatable
Class Inheritance
All Implemented Interfaces
com.sun.codemodel.JAnnotatable
Imports
java.lang.annotation.Annotation, java.util.ArrayList, .List, .Collection, .Collections

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])

Field Summary

Modifier and TypeField and Description
private final JCodeModel
private final List<JAnnotationValue>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public JAnnotationUse
annotate(Class<? extends Annotation> clazz)

Implements com.sun.codemodel.JAnnotatable.annotate.

Adds a new annotation to the array.

public JAnnotationUse
annotate(JClass clazz)

Implements com.sun.codemodel.JAnnotatable.annotate.

Adds a new annotation to the array.

public <W extends JAnnotationWriter<? extends Annotation>> W
annotate2(Class<W> clazz)

Implements com.sun.codemodel.JAnnotatable.annotate2.

Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.

public Collection<JAnnotationUse>
annotations()

Implements com.sun.codemodel.JAnnotatable.annotations.

Read-only live view of all annotations on this

public Collection<JAnnotationValue>
public void
public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(String
Adds a string value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(boolean
Adds a boolean value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(byte
Adds a byte value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(char
Adds a char value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(double
Adds a double value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(long
Adds a long value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(short
Adds a short value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(int
Adds an int value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(float
Adds a float value to the array member
value
)

Adds an array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(final Enum<?>
Adds a enum value to the array member
value
)

Adds a enum array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(final JEnumConstant
Adds a enum value to the array member
value
)

Adds a enum array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(final JExpression
Adds an expression value to the array member
value
)

Adds an expression array member to this annotation

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(final Class<?>
Adds a class value to the array member
value
)

Adds a class array member to this annotation

public JAnnotationArrayMember
param(JType type)

public JAnnotationArrayMember

Returns:

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times
param
(JAnnotationUse
Adds a annotation to the array member
value
)
Deprecated for removal since 2.3. use annotate

Adds an annotation member to this annotation array This can be used for e.g @XmlCollection(values= @XmlCollectionItem(type=Foo.class))

public boolean
removeAnnotation(JAnnotationUse annotation)

Implements com.sun.codemodel.JAnnotatable.removeAnnotation.

Removes annotation from this program element.

Field Detail

ownerback to summary
private final JCodeModel owner
valuesback to summary
private final List<JAnnotationValue> values

Constructor Detail

JAnnotationArrayMemberback to summary
pack-priv JAnnotationArrayMember(JCodeModel owner)

Method Detail

annotateback to summary
public JAnnotationUse annotate(Class<? extends Annotation> clazz)

Implements com.sun.codemodel.JAnnotatable.annotate.

Adds a new annotation to the array.

Annotations
@Override
annotateback to summary
public JAnnotationUse annotate(JClass clazz)

Implements com.sun.codemodel.JAnnotatable.annotate.

Adds a new annotation to the array.

Annotations
@Override
annotate2back to summary
public <W extends JAnnotationWriter<? extends Annotation>> W annotate2(Class<W> clazz)

Implements com.sun.codemodel.JAnnotatable.annotate2.

Doc from com.sun.codemodel.JAnnotatable.annotate2.

Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.

Annotations
@Override
annotationsback to summary
public Collection<JAnnotationUse> annotations()

Implements com.sun.codemodel.JAnnotatable.annotations.

Doc from com.sun.codemodel.JAnnotatable.annotations.

Read-only live view of all annotations on this

Annotations
@SuppressWarnings:unchecked, rawtypes
@Override
annotations2back to summary
public Collection<JAnnotationValue> annotations2()
generateback to summary
public void generate(JFormatter f)

Implements com.sun.codemodel.JGenerable.generate.

Annotations
@Override
paramback to summary
public JAnnotationArrayMember param(String value)

Adds an array member to this annotation

Parameters
value:String

Adds a string value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(boolean value)

Adds an array member to this annotation

Parameters
value:boolean

Adds a boolean value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(byte value)

Adds an array member to this annotation

Parameters
value:byte

Adds a byte value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(char value)

Adds an array member to this annotation

Parameters
value:char

Adds a char value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(double value)

Adds an array member to this annotation

Parameters
value:double

Adds a double value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(long value)

Adds an array member to this annotation

Parameters
value:long

Adds a long value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(short value)

Adds an array member to this annotation

Parameters
value:short

Adds a short value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(int value)

Adds an array member to this annotation

Parameters
value:int

Adds an int value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(float value)

Adds an array member to this annotation

Parameters
value:float

Adds a float value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(final Enum<?> value)

Adds a enum array member to this annotation

Parameters
value:Enum<?>

Adds a enum value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(final JEnumConstant value)

Adds a enum array member to this annotation

Parameters
value:JEnumConstant

Adds a enum value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(final JExpression value)

Adds an expression array member to this annotation

Parameters
value:JExpression

Adds an expression value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(final Class<?> value)

Adds a class array member to this annotation

Parameters
value:Class<?>

Adds a class value to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

paramback to summary
public JAnnotationArrayMember param(JType type)
paramback to summary
public JAnnotationArrayMember param(JAnnotationUse value)

Deprecated

for removal since 2.3.

use annotate

Adds an annotation member to this annotation array This can be used for e.g @XmlCollection(values= @XmlCollectionItem(type=Foo.class))

Parameters
value:JAnnotationUse

Adds a annotation to the array member

Returns:JAnnotationArrayMember

The JAnnotationArrayMember. More elements can be added by calling the same method multiple times

Annotations
@Deprecated
since:2.3
forRemoval:true
removeAnnotationback to summary
public boolean removeAnnotation(JAnnotationUse annotation)

Implements com.sun.codemodel.JAnnotatable.removeAnnotation.

Doc from com.sun.codemodel.JAnnotatable.removeAnnotation.

Removes annotation from this program element.

Annotations
@Override