Modifier and Type | Method and Description |
---|---|
Annotation |
addAnnotationAttribute(AnnotationAttribute annotation)
Deprecated.
Avoid using this method. Create a new
AnnotationAttribute instead. |
AnnotationAttribute |
addAnnotationAttribute(String attributeName)
Creates a new
AnnotationAttribute for a given attribute name, but
without value. |
AnnotationAttribute |
addAnnotationAttribute(String attributeName,
Expression value)
Creates a new
AnnotationAttribute for a given attribute name set
to a given value. |
AnnotationAttribute |
addDefaultValueAttribute(Expression... values)
Adds a new attribute without a key and with the given expression as
value.
|
AnnotationAttribute |
getAnnotationAttribute(String string) |
List<AnnotationAttribute> |
getAnnotationAttributes() |
String |
getEffectiveName()
Returns the actual name used for the annotation text.
|
String |
getName()
Deprecated.
The meaning of "name" is ill-defined in this interface, use
getEffectiveName() instead. |
String |
getText()
Deprecated.
The meaning of "text" is ill-defined in this interface, use
getEffectiveName() to get the effective name instead
and getAnnotationAttributes() to get the attributes
of this annotation.. |
Annotation |
setName(String name)
Deprecated.
The concept of "name" and "text" is ill-defined in this
class. Avoid using this method, set the appropriate name
using factory methods instead.
|
Annotation |
setText(String text)
Deprecated.
The concept of "name" and "text" is ill-defined in this
class. Avoid using this method, set the appropriate name
using factory methods instead. To set attributes, use
addAnnotationAttribute(String) instead. |
applyStyle, cast, getComment, isActive, isBlockWithAbruptCompletion, setComment, toCode, visit, vm
@Deprecated Annotation addAnnotationAttribute(AnnotationAttribute annotation)
AnnotationAttribute
instead.AnnotationAttribute addAnnotationAttribute(String attributeName)
AnnotationAttribute
for a given attribute name, but
without value. The attribute is appended at the end.
Note: AnnotationAttributes without value are not printed during code generation.
This feature is useful to create more complex annotations and to force an the order of attributes.
attributeName
- The key of the annotation attribute. A null
value is
interpreted (and set) as an empty String.AnnotationAttribute
instance with a name, but
without a value.AnnotationAttribute addAnnotationAttribute(String attributeName, Expression value)
AnnotationAttribute
for a given attribute name set
to a given value. The attribute is appended at the end.attributeName
- The key of the annotation attribute. A null
value is
interpreted (and set) as an empty String.value
- The value to which this attribute is set.AnnotationAttribute
instance with a name, butAnnotationAttribute addDefaultValueAttribute(Expression... values)
"value"
.
Resulting code looks like @AnnotationName(value)
values
- The expressions to use as value. If none is given, no value is
set. Use the appropriate setter in this case.AnnotationAttribute
with empty key.AnnotationAttribute getAnnotationAttribute(String string)
List<AnnotationAttribute> getAnnotationAttributes()
String getEffectiveName()
Interface ambiguity mumbles the meaning of "text" and "name". So these are deprecated for now. In the meantime use this method to get the name effectively used as the name. The name in this context is the simple class name of the Annotation in use.
@Deprecated String getName()
getEffectiveName()
instead.@Deprecated String getText()
getEffectiveName()
to get the effective name instead
and getAnnotationAttributes()
to get the attributes
of this annotation..
Usage of text is phased out (and "text" will be removed in a future
release), so usage is strongly discouraged. Use
AnnotationAttribute
s instead.
@Deprecated Annotation setName(String name)
@Deprecated Annotation setText(String text)
addAnnotationAttribute(String)
instead.Copyright © 2000–2018 jenesis4java. All rights reserved.