Class PropertyNodeBuilder


  • public final class PropertyNodeBuilder
    extends Object
    Creates a new PropertyNode instance
    Since:
    0.1.4
    • Method Detail

      • property

        public static PropertyNodeBuilder property​(String propertyName)
        Creates a builder from the property name
        Parameters:
        propertyName - the name of the property
        Returns:
        an instance of PropertyNodeBuilder
        Since:
        0.1.4
      • modifiers

        public PropertyNodeBuilder modifiers​(int modifiers)
        Sets property modifiers: static/public/...

        AST
        property('solution')
         .modifiers(A.ACC.ACC_PUBLIC)
         .build()
        Result
        public Object solution
        Parameters:
        modifiers - use A.ACC to set property modifiers
        Returns:
        current instance of PropertyNodeBuilder
        Since:
        0.1.4
      • type

        public PropertyNodeBuilder type​(Class type)
        Sets the type of the property

        AST
        property('solution')
         .modifiers(A.ACC.ACC_PUBLIC)
         .type(String)
         .build()
        Result
        public String solution
        Parameters:
        type - the Class of the property
        Returns:
        current instance of PropertyNodeBuilder
        Since:
        0.1.4
      • initialValueExpression

        public PropertyNodeBuilder initialValueExpression​(Expression initValueExpr)
        Sets an initial value for the property. AST
        property('solution')
         .modifiers(A.ACC.ACC_PUBLIC)
         .type(String)
         .initialValue(A.EXPR.constX('42'))
         .build()
        Result
        public String solution = "42"
        Parameters:
        initValueExpr - the initial value of the property
        Returns:
        current instance of PropertyNodeBuilder
        Since:
        0.1.4