Module uk.autores
Package uk.autores
An annotation driven library for working with embedded resource files. This package contains the core library functionality. See other packages for annotation processing and extensibility.
AUTORES
Usage
-
Add
import uk.autores.*;
-
Annotate a package (
ElementType.PACKAGE
) or type (ElementType.TYPE
) with one of the provided annotations -
Set
String[] values()
to the resource file names
Annotation | Consumes | Generates | Description |
---|---|---|---|
ByteArrays |
any file | class for all resources | Generate class with method per file that returns byte[] . |
InputStreams |
any file | class for all resources | Generate single class with one InputStream method per file. |
Keys |
properties | class per resource | Generate one constants class with keys per Properties file. |
Messages |
properties | class per resource | Generate one localized, formatting message generator class per Properties file. |
Texts |
text files | class for all resources | Generate class with method per text file that returns String . |
ResourceFiles |
any file | nothing (default) | Validates the resource exists. Can be used to specify a Handler with custom behaviour. |
Names
Generated type and member names are automatically derived from either the resource file name
or the annotated package name. Generated names can be influenced by either using "name"
properties (like ByteArrays.name()
) or setting Processing.namer()
.
Custom names may be required where collisions occur or derived names are not valid identifiers.
Links
-
Enum Summary Enum Description Severity Error handling choices enum.Strategy Code generation choices enum.Visibility Indicates visibility of generated code. -
Annotation Types Summary Annotation Type Description ByteArrays Directive to generate byte arrays from files.InputStreams Directive to generate classpathInputStream
opening methods from files.Keys Directive to generate key constants fromProperties
files.Messages Directive to generate localized format methods fromProperties
files.Processing Common processing instructions annotation.ResourceFiles Indicates resources that are to be processed at compile time.ResourceFiles.Cfg Configuration option.Texts Directive to generate strings from text files.