Module uk.autores.processing
Package uk.autores.processing.handlers
Use these types to extend the API.
Usage
-
Place resource files in the appropriate place for the chosen build system.
-
In Apache Maven this is typically under
src/main/resources
-
In Apache Maven this is typically under
-
Annotate a type or package declaration with
ResourceFiles
. -
Set the resource file name in the
ResourceFiles.value()
array. -
Specify a
Handler
for non-default behaviour.
Resource Handlers
Handler |
Resources | Configuration | Description |
---|---|---|---|
AssertResourceExists |
any files | (none) | Default Handler that validates resources exist. |
GenerateByteArraysFromFiles |
any files | CfgVisibility CfgStrategy |
Generates classes with a method that return a resource as a byte array. |
GenerateConstantsFromProperties |
Properties files |
CfgVisibility |
Generates classes containing String constants of the keys in a properties file. |
GenerateInputStreamsFromFiles |
any files | CfgVisibility CfgName |
Generates a single class with methods for opening resource InputStream s. |
GenerateMessagesFromProperties |
Properties files |
CfgVisibility CfgLocalize CfgMissingKey CfgFormat |
Generates classes with methods for returning property values including support for localization and message formatting. |
GenerateStringsFromText |
text files | CfgVisibility CfgEncoding CfgStrategy |
Generates classes with a method that return a resource as a string. |
-
Class Summary Class Description CfgEncoding "encoding": encoding of consumed text files.CfgFormat "format": whether to generate format methods.CfgIncompatibleFormat "incompatible-format": how to report incompatible format strings in localizedProperties
resources.CfgLocalize "localize": whether to search for localized resources.CfgMissingKey "missing-key": how to report missing keys in localizedProperties
resources.CfgName "name": generated class name.CfgStrategy "strategy": how to consume resources.CfgVisibility "visibility": set to "public" to generate public instead of package visible artefacts.GenerateByteArraysFromFiles Generates a class for loading byte data.GenerateConstantsFromProperties Use this code generationHandler
to prevent misspelled keys withResourceBundle
.GenerateInputStreamsFromFiles Handler
that, for each resource, generates a static method with a name derived from the resource name usingNamer.simplifyResourceName(String)
andNamer.nameMember(String)
.GenerateMessagesFromProperties Handler
that generates message classes fromProperties
files usingLocale
s to match localized strings andMessageFormat
to create typed method signatures.GenerateStringsFromText ResourceFiling Utility type for working withFiler
.