Package com.oracle.truffle.api
Annotation Interface InternalResource.Id
- Enclosing interface:
InternalResource
The annotation used to lookup
InternalResource
by an id. The internal resource can be
designated as either required or optional. For required internal resources, their
availability is imperative. In addition to being annotated with this annotation, they also
need to be registered using the TruffleLanguage.Registration.internalResources()
method to be associated with a specific language or instrument. On the other hand, optional
internal resources are not mandatory in the runtime. Instead of being registered using the
TruffleLanguage.Registration.internalResources()
annotation, they should supply the
relevant language or instrument id through componentId()
.- Since:
- 23.1
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionA Truffle language or instrument identifier for which the resource is registered.boolean
Marks the annotated resource as optional.
-
Element Details
-
value
String valueAn internal resource identifier that is a valid path component and unique per language.- Since:
- 23.1
-
componentId
String componentIdA Truffle language or instrument identifier for which the resource is registered. ThecomponentId
is necessary only for optional internal resources to associate them with the appropriate language or instrument. For required internal resources, thecomponentId
can be left unset.- Since:
- 23.1
- Default:
""
-
optional
boolean optionalMarks the annotated resource as optional. By default, internal resources are considered required and must be registered usingTruffleLanguage.Registration
orTruffleInstrument.Registration
. Optional internal resources are retrieved using theServiceLoader
mechanism. The service implementation is generated by an annotation processor. Therefore, for proper functionality, the Truffle DSL processor must be included in the processor path.- Since:
- 23.1
- Default:
false
-