@Target(FIELD) @Retention(SOURCE) @Documented public @interface StaticResource
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.Modifier and Type | Optional Element | Description |
---|---|---|
boolean |
relative |
If true, consider the resource path to be relative to the current package.
|
boolean |
searchClasspath |
If true, permit the resource to be in the classpath.
|
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.