Annotation Type StaticResource
Marker for a constant representing a static resource.
The annotated field must be a compile-time
String
constant whose value denotes a resource path.
For example, the resource might be an icon path intended for ImageUtilities.loadImage
.
The primary purpose of the annotation is for its processor, which will signal a compile-time error
if the resource does not in fact exist - ensuring that at least this usage will not be accidentally
broken by moving, renaming, or deleting the resource.- Since:
- 1.13
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
If true, consider the resource path to be relative to the current package.boolean
If true, permit the resource to be in the classpath.
-
Element Details
-
searchClasspath
boolean searchClasspathIf true, permit the resource to be in the classpath. By default, it may only be in the sourcepath.- Returns:
- true to search in classpath
- Default:
false
-
relative
boolean relativeIf true, consider the resource path to be relative to the current package. (../
sequences are permitted.) By default, it must be an absolute path (not starting with/
).- Returns:
- true to consider resource path to be relative to current package
- Default:
false
-