@LoadValue(value=ResourceLoader.class) @Retention(value=RUNTIME) @Target(value={PARAMETER,FIELD}) @InjectTag public @interface LoadResource
The annotation specify a field or parameter should be a resource that is loaded from path specified
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
value
Specify the resource path.
|
Modifier and Type | Optional Element and Description |
---|---|
boolean |
skipTrimLeadingSlash
By default it will remove the leading
/ from the value() . |
public abstract java.lang.String value
Specify the resource path.
The resource will be loaded by calling
Act.app().classLoader().getResource(value);
By default the leading slash in the value
will be removed, i.e. @LoadResource("/folder/file.txt")
is the same as @LoadResource("folder/file.txt")
. This behavior can be turned off by specifying skipTrimLeadingSlash()
to false
:
@LoadResource(value: "/folder/file.txt", skipTrimLeadingSlash: false);
Copyright © 2014–2017 ActFramework. All rights reserved.