Package asteroid.nodes
Class AnnotationNodeBuilder
- java.lang.Object
-
- asteroid.nodes.AnnotationNodeBuilder
-
public final class AnnotationNodeBuilder extends Object
Builder to create instances of typeAnnotationNode- Since:
- 0.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnnotationNodeBuilderannotation(Class clazz)AnnotationNodebuild()Returns the annotation node configured by this builderAnnotationNodeBuildermember(String name, Expression expression)Adds a new member to the annotation
AST
-
-
-
Method Detail
-
annotation
public static AnnotationNodeBuilder annotation(Class clazz)
Creates an instance ofAnnotationNodeBuilder
AST
Resultannotation(MyAnnotation.class).build()@MyAnnotation- Parameters:
clazz- the annotation type- Returns:
- an instance of
AnnotationNodeBuilder
-
member
public AnnotationNodeBuilder member(String name, Expression expression)
Adds a new member to the annotation
AST
Resultannotation(MyAnnotation.class) .member('value', classX(String.class)) .build()@MyAnnotation(String.class)- Parameters:
name- the name of the new memberexpression- the value of the new member. It could bePropertyExpressionClassExpression, or aConstantExpression- Returns:
- the current instance of
AnnotationNodeBuilder
-
build
public AnnotationNode build()
Returns the annotation node configured by this builder- Returns:
- an instance of
AnnotationNode
-
-