Annotation Interface NodeField


@Retention(CLASS) @Target(TYPE) @Repeatable(NodeFields.class) public @interface NodeField
A NodeField element defines a field for the generated Node. A Node contains multiple NodeFields specified in linear declaration order. The field can be accessed by declaring an abstract getter or setter named "get" + firstLetterUpperCase(name())() (or "is" + firstLetterUpperCase(name())() in case of a boolean node field) and "set" + firstLetterUpperCase(name())(). If no setter is specified then the resulting field will be final and passed in as constructor argument to the create factory method. If an abstract setter was specified then the field will be mutable and not passed in as constructor argument. Note that the generated mutable field will not be CompilerDirectives.CompilationFinal.

If the NodeField is used in combination with GenerateUncached then the generated getters or setters throw an UnsupportedOperationException for the uncached variant of the node.

Since:
0.8 or earlier
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
     
  • Element Details

    • name

      String name
      Since:
      0.8 or earlier
    • type

      Class<?> type
      Since:
      0.8 or earlier