Indicates resources that are to be processed at compile time.
@ResourceFiles("some-resource.txt")
The compiler must be able to load referenced resources using
Filer.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.
It is recommended that resources be placed in a bundled directory path equivalent to the type or package.
For example, annotated class foo.bar.Baz
can reference the relative resource
foo/bar/X.txt
with the string "X.txt"
.
Absolute paths like "/META-INF/resources/X.txt
must be start with a forward slash.
As a minimum this annotation can be used to verify a resource exists without the need for unit tests.
Set handler()
for other behaviour.
Custom generation or validation can be provided by implementing a Handler
.
Alternative naming strategies can be set by providing a Namer
via processing()
.
The compiler must be able to load and instantiate any value set in handler()
.
This typically means compiling the code in a separate project to the one where they are used.
-
Nested Class Summary
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionSome implementations ofHandler
support configuration.Enables non-default resource handling.Common processing instructions
-
Element Details
-
value
String[] valueDefines the resource files to be processed. In an Apache Maven project these will likely be placed in thesrc/main/resources
directory.- Returns:
- the resources to handle
-
handler
Enables non-default resource handling.- Returns:
- the Handler for these resources
- See Also:
- Default:
uk.autores.handling.AssertResourceExists.class
-
processing
Processing processingCommon processing instructions- Returns:
- processing instructions
- Default:
@uk.autores.Processing(namer=uk.autores.naming.Namer.class)
-
config
ResourceFiles.Cfg[] configSome implementations ofHandler
support configuration.- Returns:
- configured options
- See Also:
- Default:
{}
-