Annotation Type JSON


  • @Documented
    @Target(PARAMETER)
    @Retention(RUNTIME)
    public @interface JSON

    Method parameter annotation that is used for telling Martini what the default value is if the request has no value and the request was expected to be in JSON format. The value can be a string value, or a method name.

    When using a method name, the value should start with a dollar sign ($). When it points to a method name, Martini will instantiate a new object from the containing class and invoke the method. For example, if your annotation has a value of $defaultValue, Martini will invoke defaultValue() on the containing class. The returned object from this method is then used as the default value.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String value  
    • Element Detail

      • value

        String value
        Default:
        ""