Annotation Interface FieldDeclaration


@Target(METHOD) @Retention(RUNTIME) public @interface FieldDeclaration

Marks a method as a field declaration. New field's name becomes this annotation's name() parameter or the annotated method's name if the name() is empty.

The annotated method must be non-void and have a single argument. The argument's type denotes the fact type that we want to declare a new field on. The method's return type becomes the field's type.

The annotated method can use both instance and static class members to compute field value.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Identifies the name of the field being declared.
    Optional logical type on which this field is declared.
  • Element Details

    • name

      String name
      Identifies the name of the field being declared. If the name is omitted, the field is named after the annotated method.
      Returns:
      field name
      Default:
      ""
    • type

      String type
      Optional logical type on which this field is declared. If the type is omitted, the engine will derive the fact's type from the method's single argument.
      Returns:
      logical type
      See Also:
      Default:
      ""