Annotation Interface Example


An example to be used in documentation for the annotated element. Multiple example annotations can be stacked on a single syntax element.

Each annotation should include a single example. This can be used instead of the existing Examples annotation.

Multi-line examples should use multi-line strings. Note that whitespace and quotes do not need to be escaped in this mode. The indentation will start from the least-indented line (and most IDEs provide a guideline to show this).


 @Example("set player's health to 1")
 @Example("""
 		if player's health is greater than 10:
 			send "Wow you're really healthy!"
 		""")
 @Example("""
 		# sets the player's health to 1
 		set player's health to 1""")
 public class MyExpression extends ... {
 }
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    The internal container annotation for multiple examples.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
  • Element Details

    • value

      String value
    • inTrigger

      boolean inTrigger
      Default:
      true