public final class AnnotationNodeBuilder
extends java.lang.Object
AnnotationNode| Modifier and Type | Method and Description |
|---|---|
static AnnotationNodeBuilder |
annotation(java.lang.Class clazz)
|
AnnotationNode |
build()
Returns the annotation node configured by this builder
|
AnnotationNodeBuilder |
member(java.lang.String name,
Expression expression)
Adds a new member to the annotation
AST |
public static AnnotationNodeBuilder annotation(java.lang.Class clazz)
AnnotationNodeBuilder
annotation(MyAnnotation.class).build()
Result
@MyAnnotationclazz - the annotation typeAnnotationNodeBuilderpublic AnnotationNodeBuilder member(java.lang.String name, Expression expression)
annotation(MyAnnotation.class)
.member('value', classX(String.class))
.build()
Result
@MyAnnotation(String.class)name - the name of the new memberexpression - the value of the new member. It could be PropertyExpression
ClassExpression, or a ConstantExpressionAnnotationNodeBuilderpublic AnnotationNode build()
AnnotationNode