public final class JAnnotationUse extends JAnnotationValue
Modifier and Type | Field and Description |
---|---|
private JClass |
clazz
The
Annotation class |
private java.util.Map<java.lang.String,JAnnotationValue> |
memberValues
Map of member values.
|
Constructor and Description |
---|
JAnnotationUse(JClass clazz) |
Modifier and Type | Method and Description |
---|---|
private void |
addValue(java.lang.String name,
JAnnotationValue annotationValue) |
JAnnotationUse |
annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
|
JAnnotationUse |
annotationParam(java.lang.String name,
java.lang.Class<? extends java.lang.annotation.Annotation> value)
Adds a member value pair to this annotation
For adding class values as param
|
void |
generate(JFormatter f) |
JClass |
getAnnotationClass() |
java.util.Map<java.lang.String,JAnnotationValue> |
getAnnotationMembers() |
private boolean |
isOptimizable() |
private JCodeModel |
owner() |
JAnnotationUse |
param(java.lang.String name,
boolean value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
byte value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
char value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
java.lang.Class<?> value)
Adds a member value pair to this annotation
This can be used for e.g to specify
|
JAnnotationUse |
param(java.lang.String name,
double value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
java.lang.Enum<?> value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
float value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
int value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
JEnumConstant value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
JExpression value)
Adds a member value pair to this annotation.
|
JAnnotationUse |
param(java.lang.String name,
JType type)
Adds a member value pair to this annotation based on the
type represented by the given JType
|
JAnnotationUse |
param(java.lang.String name,
long value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
short value)
Adds a member value pair to this annotation
|
JAnnotationUse |
param(java.lang.String name,
java.lang.String value)
Adds a member value pair to this annotation
|
JAnnotationArrayMember |
paramArray(java.lang.String name)
Adds a member value pair which is of type array to this annotation
|
private final JClass clazz
Annotation
classprivate java.util.Map<java.lang.String,JAnnotationValue> memberValues
JAnnotationUse(JClass clazz)
public JClass getAnnotationClass()
public java.util.Map<java.lang.String,JAnnotationValue> getAnnotationMembers()
private JCodeModel owner()
private void addValue(java.lang.String name, JAnnotationValue annotationValue)
public JAnnotationUse param(java.lang.String name, boolean value)
name
- The simple name for this annotationvalue
- The boolean value for this annotationpublic JAnnotationUse param(java.lang.String name, byte value)
name
- The simple name for this annotationvalue
- The byte member value for this annotationpublic JAnnotationUse param(java.lang.String name, char value)
name
- The simple name for this annotationvalue
- The char member value for this annotationpublic JAnnotationUse param(java.lang.String name, double value)
name
- The simple name for this annotationvalue
- The double member value for this annotationpublic JAnnotationUse param(java.lang.String name, float value)
name
- The simple name for this annotationvalue
- The float member value for this annotationpublic JAnnotationUse param(java.lang.String name, long value)
name
- The simple name for this annotationvalue
- The long member value for this annotationpublic JAnnotationUse param(java.lang.String name, short value)
name
- The simple name for this annotationvalue
- The short member value for this annotationpublic JAnnotationUse param(java.lang.String name, int value)
name
- The simple name for this annotationvalue
- The int member value for this annotationpublic JAnnotationUse param(java.lang.String name, java.lang.String value)
name
- The simple name for this annotationvalue
- The String member value for this annotationpublic JAnnotationUse annotationParam(java.lang.String name, java.lang.Class<? extends java.lang.annotation.Annotation> value)
name
- The simple name for this annotationvalue
- The annotation class which is member value for this annotationparam(String, Class)
public JAnnotationUse param(java.lang.String name, java.lang.Enum<?> value)
name
- The simple name for this annotationvalue
- The enum class which is member value for this annotationpublic JAnnotationUse param(java.lang.String name, JEnumConstant value)
name
- The simple name for this annotationvalue
- The JEnumConstant which is member value for this annotationpublic JAnnotationUse param(java.lang.String name, java.lang.Class<?> value)
@XmlCollectionItem(type=Integer.class);For adding a value of Class extends Annotation>
name
- The simple name for this annotation paramvalue
- The class type of the parampublic JAnnotationUse param(java.lang.String name, JType type)
name
- The simple name for this annotation paramtype
- the JType representing the actual typepublic JAnnotationUse param(java.lang.String name, JExpression value)
name
- The simple name for this annotationvalue
- The JExpression which provides the contant value for this annotationpublic JAnnotationArrayMember paramArray(java.lang.String name)
name
- The simple name for this annotationJAnnotationArrayMember
public JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
JAnnotationArrayMember.annotate(java.lang.Class<? extends java.lang.annotation.Annotation>)
clazz
- The annotation class to be includedpublic void generate(JFormatter f)
private boolean isOptimizable()