org.mule.devkit.model.code
Class GeneratedAnnotationUse

java.lang.Object
  extended by org.mule.devkit.model.code.AnnotationValue
      extended by org.mule.devkit.model.code.GeneratedAnnotationUse
All Implemented Interfaces:
Generable

public final class GeneratedAnnotationUse
extends AnnotationValue

Represents an annotation on a program element.

TODO How to add enums to the annotations

Author:
Bhakti Mehta (bhakti.mehta@sun.com)

Method Summary
 GeneratedAnnotationUse annotate(Class<? extends Annotation> clazz)
          Deprecated. use AnnotationArrayMember.annotate(java.lang.Class)
 GeneratedAnnotationUse annotationParam(String name, Class<? extends Annotation> value)
          Adds a member value pair to this annotation For adding class values as param
 void generate(Formatter f)
           
 TypeReference getAnnotationClass()
           
 Map<String,AnnotationValue> getAnnotationMembers()
           
 GeneratedAnnotationUse param(String name, boolean value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, byte value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, char value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, Class<?> value)
          Adds a member value pair to this annotation This can be used for e.g to specify
 GeneratedAnnotationUse param(String name, double value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, Enum<?> value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, EnumConstant value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, float value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, GeneratedExpression value)
          Adds a member value pair to this annotation.
 GeneratedAnnotationUse param(String name, int value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, long value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, short value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, String value)
          Adds a member value pair to this annotation
 GeneratedAnnotationUse param(String name, Type type)
          Adds a member value pair to this annotation based on the type represented by the given Type
 AnnotationArrayMember paramArray(String name)
          Adds a member value pair which is of type array to this annotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAnnotationClass

public TypeReference getAnnotationClass()

getAnnotationMembers

public Map<String,AnnotationValue> getAnnotationMembers()

param

public GeneratedAnnotationUse param(String name,
                                    boolean value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The boolean value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    byte value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The byte member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    char value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The char member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    double value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The double member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    float value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The float member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    long value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The long member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    short value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The short member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    int value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The int member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    String value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The String member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

annotationParam

public GeneratedAnnotationUse annotationParam(String name,
                                              Class<? extends Annotation> value)
Adds a member value pair to this annotation For adding class values as param

Parameters:
name - The simple name for this annotation
value - The annotation class which is member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.
See Also:
param(String, Class)

param

public GeneratedAnnotationUse param(String name,
                                    Enum<?> value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The enum class which is member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    EnumConstant value)
Adds a member value pair to this annotation

Parameters:
name - The simple name for this annotation
value - The EnumConstant which is member value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    Class<?> value)
Adds a member value pair to this annotation This can be used for e.g to specify
        @XmlCollectionItem(type=Integer.class);
 
 For adding a value of Class

Parameters:
name - The simple name for this annotation param
value - The class type of the param
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    Type type)
Adds a member value pair to this annotation based on the type represented by the given Type

Parameters:
name - The simple name for this annotation param
type - the Type representing the actual type
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

param

public GeneratedAnnotationUse param(String name,
                                    GeneratedExpression value)
Adds a member value pair to this annotation.

Parameters:
name - The simple name for this annotation
value - The Expression which provides the contant value for this annotation
Returns:
The AnnotationUse. More member value pairs can be added to it using the same or the overloaded methods.

paramArray

public AnnotationArrayMember paramArray(String name)
Adds a member value pair which is of type array to this annotation

Parameters:
name - The simple name for this annotation
Returns:
The AnnotationArrayMember. For adding array values
See Also:
AnnotationArrayMember

annotate

public GeneratedAnnotationUse annotate(Class<? extends Annotation> clazz)
Deprecated. use AnnotationArrayMember.annotate(java.lang.Class)

This can be used to add annotations inside annotations for e.g @XmlCollection(values= @XmlCollectionItem(type=Foo.class))

Parameters:
clazz - The annotation class to be included
Returns:
The AnnotationUse that can be used as a member within this AnnotationUse

generate

public void generate(Formatter f)


Copyright © 2010–2014 MuleSoft, Inc.. All rights reserved.