Annotation for use on CodeDelegate subclasses to create a class body
template file during compilation. This relies on the compiler in use allowing
the annotation processor to load source files.
Add the token values in comments. All lines between
PXJ-BEGIN: and
PXJ-END: will be copied into the template, excluding the lines
containing the template. It is advised to write an ID for the section (eg.
body, imports, etc.) after the tokens, but these are not checked in processing.
invalid input: '{@code
@GenerateTemplate(Foo.TEMPLATE_PATH)
class Foo extends CoreCodeDelegate {
final static String TEMPLATE_PATH = "resources/foo.pxj";
// PXJ-BEGIN:body
@Override
public void update() {
}
// PXJ-END:body
}
</pre>'-
Field Details
-
TOKEN_BEGIN
Value of the starting token -PXJ-BEGIN:- See Also:
-
TOKEN_END
Value of the ending token -PXJ-END:- See Also:
-
-
Element Details
-
value
String valuePath, relative to the Java source file, to generate the template. The file should usually be given a.pxjextension. It can be stored in a final static field in the class for use in the factory (see main example).- Returns:
- relative path to template file
-