Module uk.autores
Package 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.
Retention
Annotations in this package have RetentionPolicy.SOURCE
retention.
They are compile-time only.
Links
-
ClassDescriptionDirective to generate byte arrays from files.Directive to generate classpath
InputStream
opening methods from files.Directive to generate key constants fromProperties
files.Directive to generate localized format methods fromProperties
files.Common processing instructions annotation.Indicates resources that are to be processed at compile time.Configuration option.Error handling choices enum.Code generation choices enum.Directive to generate strings from text files.Indicates visibility of generated code.