Module uk.autores
Package uk.autores.handling
package uk.autores.handling
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. |
-
ClassDescriptionA resource handler that does nothing but can be used to ensure a resource exists at compile time."encoding": encoding of consumed text files."format": whether to generate format methods."incompatible-format": how to report incompatible format strings in localized
Properties
resources."localize": whether to search for localized resources."missing-key": how to report missing keys in localizedProperties
resources."name": generated class name."strategy": how to consume resources."visibility": set to "public" to generate public instead of package visible artefacts.Config item derived fromResourceFiles.config()
.Defines the configuration supported by aHandler
.Context information for processing resource files.Implementation of the builder pattern forContext
.Handler
that, for each resource, generates a class with a name derived from the resource name usingNamer.simplifyResourceName(String)
andNamer.nameType(String)
.Use this code generationHandler
to prevent misspelled keys withResourceBundle
.Handler
that, for each resource, generates a static method with a name derived from the resource name usingNamer.simplifyResourceName(String)
andNamer.nameMember(String)
.Handler
that generates message classes fromProperties
files usingLocale
s to match localized strings andMessageFormat
to create typed method signatures.Processes resources from the class path.Character representation of a Java package.A representation of the annotated resource.For retrieving resource contents.Indicates resources that are to be processed at compile time.Configuration option.Utility type for working withFiler
.