Package jakarta.annotation
Annotation Type Resource
@Target({TYPE,METHOD,FIELD})
@Retention(RUNTIME)
@Repeatable(Resources.class)
public @interface Resource
Indicates a resource required by the application. Annotated classes will be used as resources. Annotated fields
 and/or methods will have resources injected.
- Since:
- Common Annotations 1.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe AuthenticationType, either CONTAINER or APPLICATION
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionbooleanClass<?>Uses generics since Common Annotations 1.2.
- 
Element Details- 
nameString name- Returns:
- a String with the name of the resource
 - Default:
- ""
 
- 
typeClass<?> typeUses generics since Common Annotations 1.2.- Returns:
- The type for instances of this resource
 - Default:
- java.lang.Object.class
 
- 
authenticationTypeResource.AuthenticationType authenticationType- Returns:
- the AuthenticationType of the resource default CONTAINER
 - Default:
- CONTAINER
 
- 
descriptionString description- Returns:
- a string with the description for the resource
 - Default:
- ""
 
- 
mappedNameString mappedName- Returns:
- a string with the mappedName of the resource
 - Default:
- ""
 
- 
lookupString lookup- Returns:
- The name of the entry, if any, to use for this resource
- Since:
- Common Annotations 1.1
 - Default:
- ""
 
 
-