Annotation Type Generator.RunsLocal

Enclosing class:
Generator

@Inherited @Retention(RUNTIME) public static @interface Generator.RunsLocal
An optional annotation indicating that a Generator can be run with local information during incremental compilation.

When this annotation is applied, the generator cannot access global level type information (e.g. JClassType#getSubTypes or TypeOracle#getTypes) and also accesses to property values are restricted to the ones defined by #requiredProperties.

This information is used by Generator invocation during incremental compilation to run Generators as early as possible in the compile tree (and thus as parallelized and cached as possible).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The list of names of properties which will be accessed by this Generator.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A special value for requiresProperties() to indicate that any property can affect this generator's output.
  • Field Details

    • ALL

      static final String ALL
      A special value for requiresProperties() to indicate that any property can affect this generator's output. While this gives access to any property value, this may slowdown the compilation speed to precompute all property values.
      See Also:
  • Element Details

    • requiresProperties

      String[] requiresProperties
      The list of names of properties which will be accessed by this Generator. It is assumed that any change in the values of these properties will affect the content of Generator output.

      Any Generator that depends on properties will have its execution delayed to the point in the compile tree where it is known that the properties it cares about have stopped changing. In general this result of pushing Generator execution towards the root of the tree has negative performance consequences on incremental compile performance.

      Generators that want to be as fast as possible should strive not to read any properties.

      Can be set to RunsLocal.ALL to indicate a need to arbitrarily access any property.

      Default:
      {}