Annotation Interface JStacheFlags


Compiler feature flags that are subject to change. Use at your own risk!

Flags maybe added without a major version change unlike the rest of the API. If a flag becomes popular enough it will eventually make its way to JStacheConfig so please file an issue if you depend on flag and would like it to remain in the library.

Order of flag lookup and precedence is as follows:

  1. type annotated with JStache and this annotation.
  2. enclosing class (of type annotated with JStache) with this annotation with inner to outer order.
  3. package annotated with this annotation.
  4. module annotated with this annotation.
  5. annotation processor compiler arg options (-A). The flags are lowercased and prefixed with "jstache."
The flags() are NOT combined but rather the first found that is NOT containing JStacheFlags.Flag.UNSPECIFIED dictates the flags set or not (including empty). If other flags are set with UNSPECIFIED they will be ignored.
Author:
agentgt
API Note
the retention policy is purposely RetentionPolicy.SOURCE as these flags only impact compiling of the template.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Compiler flags.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Compiler flags that will be used on for this model.
    Class<? extends Annotation>
    EXPERIMENTAL: Annotation to use for marking nullable types in generated code.
  • Element Details

    • flags

      Compiler flags that will be used on for this model. The flags() are NOT combined but rather the first found that is NOT containing JStacheFlags.Flag.UNSPECIFIED dictates the flags set or not (including empty). If other flags are set with UNSPECIFIED they will be ignored.
      Returns:
      flags defaults to a single unspecified.
      See Also:
      Default:
      {UNSPECIFIED}
    • nullableAnnotation

      EXPERIMENTAL: Annotation to use for marking nullable types in generated code. Normally JStachio will just put a comment like "/* @Nullable */" for allowed nulls.

      For example by default a formatter that accepts nulls will be generated like:

       
       Function</* @Nullable */ Object, String> formatter;
        
      If this feature is turned on then the comment will be replaced with the given annotation.

      The annotation must be a ElementType.TYPE_USE compatible annotation. Also known as JSR 308. Most JSR 305 style annotations will not work!

      The default return annotation of Inherited has no special meaning other than UNSPECIFIED and will not actually be used. It was chosen arbitrarily because there are currently no annotations in java.base that correlate with this behavior.

      Returns:
      Inherited signaling unspecified (it will not actually be used).
      API Note
      The annotation other than the unspecified must be a ElementType.TYPE_USE.
      Default:
      java.lang.annotation.Inherited.class