Annotation Type Patch


  • @Documented
    @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Patch
    Annotation for methods that apply submitted representations as a patch. Its semantics is equivalent to an HTTP PATCH method. Note that your method must have one input parameter if you want it to be selected for requests containing an entity.

    Example:
     @Patch
     public Representation update(Representation input);
     
     @Patch("json-patch")
     public String updateJson(String value);
     
     @Patch("json-patch|xml-patch:xml|json")
     public Representation update(Representation value);
     
     @Patch("json?param=val")
     public Representation updateWithParam(String value);
     
     @Patch("json?param")
     public Representation updateWithParam(String value);
     
     @Patch("?param")
     public Representation updateWithParam(String value);
     
    Author:
    Jerome Louvel
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String value
      Specifies the media type of the request and response entities as extensions.
    • Element Detail

      • value

        java.lang.String value
        Specifies the media type of the request and response entities as extensions. If only one extension is provided, the extension applies to both request and response entities. If two extensions are provided, separated by a colon, then the first one is for the request entity and the second one for the response entity.

        If several media types are supported, their extension can be specified separated by "|" characters. Note that this isn't the full MIME type value, just the extension name declared in MetadataService. For a list of all predefined extensions, please check MetadataService.addCommonExtensions(). New extension can be registered using MetadataService.addExtension(String, org.restlet.data.Metadata) method.
        Returns:
        The media types of request and/or response entities.
        Default:
        ""