Annotation Interface InternalResource.Id

Enclosing interface:
InternalResource

@Retention(RUNTIME) @Target(TYPE) public static @interface InternalResource.Id
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

    Required Elements
    Modifier and Type
    Required Element
    Description
    An internal resource identifier that is a valid path component and unique per language.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A Truffle language or instrument identifier for which the resource is registered.
    boolean
    Marks the annotated resource as optional.
  • Element Details

    • value

      String value
      An internal resource identifier that is a valid path component and unique per language.
      Since:
      23.1
    • componentId

      String componentId
      A Truffle language or instrument identifier for which the resource is registered. The 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.
      Since:
      23.1
      Default:
      ""
    • optional

      boolean optional
      Marks the annotated resource as optional. By default, internal resources are considered required and must be registered using 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.
      Since:
      23.1
      Default:
      false