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:
- type annotated with JStache and this annotation.
- enclosing class (of type annotated with JStache) with this annotation with inner to outer order.
- package annotated with this annotation.
- module annotated with this annotation.
- annotation processor compiler arg options (
-A
). The flags are lowercased and prefixed with "jstache.
"
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
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionCompiler 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. Theflags()
are NOT combined but rather the first found that is NOT containingJStacheFlags.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
Class<? extends Annotation> nullableAnnotationEXPERIMENTAL: 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;
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
-