Annotation Interface ExportMessage


@Retention(RUNTIME) @Target({METHOD,TYPE}) @Repeatable(Repeat.class) public @interface ExportMessage
Exports the annotated method or class as library message. The annotation can only be applied to method or classes with an enclosing class annotated by ExportLibrary. Exported messages are inherited to subclasses of the enclosing class. If they are redeclared in the sub-class then the semantics of the overridden message is replaced by the semantics of the sub-class. A class and a method cannot be exported at the same time for a single message and enclosing class.
Since:
19.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Explicitly ignores warning messages originating from the ExportLibrary annotation.
    static @interface 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Library>
    Returns the library to export by this method or class.
    Specifies the limit of an exported message.
    Returns the message simple name to export.
  • Element Details

    • name

      String name
      Returns the message simple name to export. If not specified, the exported message name is inherited from the enclosing method name or class. In case of an exported class the first letter is automatically translated to lower-case. The name attribute should be specified if the exported message does not match the exported method or class name or if multiple messages need to be exported for a method or class.
      Since:
      19.0
      Default:
      ""
    • library

      Class<? extends Library> library
      Returns the library to export by this method or class. Automatically selected if the name of the message is unique. Needs to be specified if the name is not unique when implementing multiple libraries.
      Since:
      19.0
      Default:
      com.oracle.truffle.api.library.Library.class
    • limit

      String limit
      Specifies the limit of an exported message. The limit specifies the number of specialized instances of cached library should be used until the library rewrites itself to an uncached case.
      Since:
      19.0
      See Also:
      Default:
      ""