public final class PropertyNodeBuilder
extends java.lang.Object
PropertyNode instance| Modifier and Type | Method and Description |
|---|---|
PropertyNode |
build()
Returns the initialized
PropertyNode |
PropertyNodeBuilder |
initialValueExpression(Expression initValueExpr)
Sets an initial value for the property.
|
PropertyNodeBuilder |
modifiers(int modifiers)
Sets property modifiers: static/public/...
|
PropertyNodeBuilder |
owner(ClassNode owner)
Sets the property owner
|
static PropertyNodeBuilder |
property(java.lang.String propertyName)
Creates a builder from the property name
|
PropertyNodeBuilder |
type(java.lang.Class type)
Sets the type of the property
AST |
public static PropertyNodeBuilder property(java.lang.String propertyName)
propertyName - the name of the propertyPropertyNodeBuilderpublic PropertyNodeBuilder modifiers(int modifiers)
property('solution')
.modifiers(A.ACC.ACC_PUBLIC)
.build()
Result
public Object solutionmodifiers - use A.ACC to set property modifiersPropertyNodeBuilderpublic PropertyNodeBuilder type(java.lang.Class type)
property('solution')
.modifiers(A.ACC.ACC_PUBLIC)
.type(String)
.build()
Result
public String solutiontype - the Class of the propertyPropertyNodeBuilderpublic PropertyNodeBuilder owner(ClassNode owner)
owner - to which class node this property belongsPropertyNodeBuilderpublic PropertyNodeBuilder initialValueExpression(Expression initValueExpr)
property('solution')
.modifiers(A.ACC.ACC_PUBLIC)
.type(String)
.initialValue(A.EXPR.constX('42'))
.build()
Result
public String solution = "42"initValueExpr - the initial value of the propertyPropertyNodeBuilderpublic PropertyNode build()
PropertyNodePropertyNode instance built by this builder