Module uk.autores
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
Handlerfor 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 InputStreams. |
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. |
-
Interface Summary Interface Description Handler Processes resources from the class path.Resource.ResourceOpener For retrieving resource contents. -
Class Summary Class Description AssertResourceExists A resource handler that does nothing but can be used to ensure a resource exists at compile time.CfgEncoding "encoding": encoding of consumed text files.CfgFormat "format": whether to generate format methods.CfgLocalize "localize": whether to search for localized resources.CfgMissingKey "missing-key": how to report missing keys in localizedPropertiesresources.CfgName "name": generated class name.CfgStrategy "strategy": how to consume resources.CfgVisibility "visibility": set to "public" to generate public instead of package visible artefacts.Config Config item derived fromResourceFiles.config().ConfigDef Defines the configuration supported by aHandler.Context Context information for processing resource files.Context.Builder Implementation of the builder pattern forContext.GenerateByteArraysFromFiles Handlerthat, for each resource, generates a class with a name derived from the resource name usingNamer.simplifyResourceName(String)andNamer.nameType(String).GenerateConstantsFromProperties Use this code generationHandlerto prevent misspelled keys withResourceBundle.GenerateInputStreamsFromFiles Handlerthat, for each resource, generates a static method with a name derived from the resource name usingNamer.simplifyResourceName(String)andNamer.nameMember(String).GenerateMessagesFromProperties Handlerthat generates message classes fromPropertiesfiles usingLocales to match localized strings andMessageFormatto create typed method signatures.GenerateStringsFromText Pkg Character representation of a Java package.Resource A representation of the annotated resource.ResourceFiling Utility type for working withFiler. -
Annotation Types Summary Annotation Type Description ResourceFiles Indicates resources that are to be processed at compile time.ResourceFiles.Cfg Configuration option.