com.sun.codemodel
Class JAnnotationArrayMember

java.lang.Object
  extended by com.sun.codemodel.JAnnotationValue
      extended by com.sun.codemodel.JAnnotationArrayMember
All Implemented Interfaces:
JAnnotatable

public final class JAnnotationArrayMember
extends JAnnotationValue
implements JAnnotatable

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 (bhakti.mehta@sun.com)

Method Summary
 JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
          Adds a new annotation to the array.
 JAnnotationUse annotate(JClass clazz)
          Adds a new annotation to the array.
<W extends JAnnotationWriter>
W
annotate2(java.lang.Class<W> clazz)
          Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
 void generate(JFormatter f)
           
 JAnnotationArrayMember param(boolean value)
           
 JAnnotationArrayMember param(java.lang.Class value)
           
 JAnnotationArrayMember param(float value)
          Adds an array member to this annotation
 JAnnotationArrayMember param(int value)
          Adds an array member to this annotation
 JAnnotationArrayMember param(JAnnotationUse value)
          Deprecated. use annotate(java.lang.Class)
 JAnnotationArrayMember param(JType type)
           
 JAnnotationArrayMember param(java.lang.String value)
          Adds an array member to this annotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

param

public JAnnotationArrayMember param(java.lang.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)

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(java.lang.Class value)

param

public JAnnotationArrayMember param(JType type)

annotate

public JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Adds a new annotation to the array.

Specified by:
annotate in interface JAnnotatable
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 interface JAnnotatable
Parameters:
clazz - The annotation class to annotate the program element with

annotate2

public <W extends JAnnotationWriter> W annotate2(java.lang.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 interface JAnnotatable

param

public JAnnotationArrayMember param(JAnnotationUse value)
Deprecated. use annotate(java.lang.Class)

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)


Copyright © 2005-2010 Sun Microsystems. All Rights Reserved.