Annotation Type Example


@Retention(RUNTIME) @Target(TYPE) public @interface Example
Allows a call to include an example URL and sample inputs and outputs in the generated documentation.
Author:
Tim Boudreau
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the field on the class returned by inputType() to find an object which can be rendered as JSON sample input in the documentation of this call.
    The class to look for the value of inputField() on, to instantiate and convert to JSON an example of input to this method.
    The name of the field on the class returned by outputType() to find an object which can be rendered as JSON sample output in the documentation of this call.
    The class to look for the value of outputField() on, to instantiate and convert to JSON an example of output of this method.
    Example usage - typically a sample URL.
  • Element Details

    • value

      String value
      Example usage - typically a sample URL.
      Returns:
      Default:
      ""
    • inputType

      Class<?> inputType
      The class to look for the value of inputField() on, to instantiate and convert to JSON an example of input to this method. If a string, will be rendered in the help in pre tags. The field must be static but need not be public.
      Returns:
      A field name
      Default:
      java.lang.Object.class
    • inputField

      String inputField
      The name of the field on the class returned by inputType() to find an object which can be rendered as JSON sample input in the documentation of this call.
      Returns:
      A field name
      Default:
      "EXAMPLE"
    • outputType

      Class<?> outputType
      The class to look for the value of outputField() on, to instantiate and convert to JSON an example of output of this method. If a string, will be rendered in the help in pre tags.
      Returns:
      A field name
      Default:
      java.lang.Object.class
    • outputField

      String outputField
      The name of the field on the class returned by outputType() to find an object which can be rendered as JSON sample output in the documentation of this call. The field must be static but need not be public.
      Returns:
      A field name
      Default:
      "EXAMPLE"