Annotation Type JSONP


@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) public @interface JSONP
Note: applicable to annotations to allow bundling (if support added to Jakarta-RS bundle itself), as well as methods to indicate that return type is to be wrapped. Other types are not allowed, since there is no current usage for those; input can't be wrapped (so no need for parameters); fields are not exposed through Jakarta-RS; and we do not allow 'default wrapping' for types.

Note on properties: if either prefix() or suffix() is non-empty, they are used as literal prefix and suffix to use. Otherwise value() is used as the function name, followed by opening parenthesis, value, and closing parenthesis.

Example usage:

  class Wrapper {
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Helper class for encapsulating information from JSONP annotation instance.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Prefix String used for JSONP if not empty: will be included verbatim before JSON value.
    Suffix String used for JSONP if not empty: will be included verbatim after JSON value.
    Method used for JSONP, unless prefix() or suffix() return non-empty Strings.
  • Element Details

    • value

      String value
      Method used for JSONP, unless prefix() or suffix() return non-empty Strings.
      Default:
      ""
    • prefix

      String prefix
      Prefix String used for JSONP if not empty: will be included verbatim before JSON value.
      Default:
      ""
    • suffix

      String suffix
      Suffix String used for JSONP if not empty: will be included verbatim after JSON value.
      Default:
      ""