@Retention(value=RUNTIME) @Target(value=TYPE) public static @interface InternalResource.Id
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 InternalResource.Id.componentId().| Modifier and Type | Required Element and Description |
|---|---|
String |
value
An internal resource identifier that is a valid path component and unique per language.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
componentId
A Truffle language or instrument identifier for which the resource is registered.
|
boolean |
optional
Marks the annotated resource as optional.
|
public abstract String value
public abstract String componentId
componentId is necessary only for optional internal resources to associate them
with the appropriate language or instrument. For required internal resources, the
componentId can be left unset.public abstract boolean optional
TruffleLanguage.Registration or
TruffleInstrument.Registration. Optional internal resources are retrieved using
the ServiceLoader 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.