2
* Copyright 2005-2012 Restlet S.A.S.
4
* The contents of this file are subject to the terms of one of the following
5
* open source licenses: Apache 2.0 or LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL
6
* 1.0 (the "Licenses"). You can select the license that you prefer but you may
7
* not use this file except in compliance with one of these Licenses.
9
* You can obtain a copy of the Apache 2.0 license at
10
* http://www.opensource.org/licenses/apache-2.0
12
* You can obtain a copy of the LGPL 3.0 license at
13
* http://www.opensource.org/licenses/lgpl-3.0
15
* You can obtain a copy of the LGPL 2.1 license at
16
* http://www.opensource.org/licenses/lgpl-2.1
18
* You can obtain a copy of the CDDL 1.0 license at
19
* http://www.opensource.org/licenses/cddl1
21
* You can obtain a copy of the EPL 1.0 license at
22
* http://www.opensource.org/licenses/eclipse-1.0
24
* See the Licenses for the specific language governing permissions and
25
* limitations under the Licenses.
27
* Alternatively, you can obtain a royalty free commercial license with less
28
* limitations, transferable or non-transferable, directly at
29
* http://www.restlet.com/products/restlet-framework
31
* Restlet is a registered trademark of Restlet S.A.S.
34
package org.restlet.resource;
36
import java.lang.annotation.Documented;
37
import java.lang.annotation.ElementType;
38
import java.lang.annotation.Retention;
39
import java.lang.annotation.RetentionPolicy;
40
import java.lang.annotation.Target;
42
import org.restlet.engine.Method;
43
import org.restlet.service.MetadataService;
46
* Annotation for methods that store submitted representations. Its semantics is
47
* equivalent to an HTTP PUT method. Note that your method must have one input
48
* parameter if you want it to be selected for requests containing an entity.<br>
54
* public MyOutputBean store(MyInputBean input);
56
* @Put("json")
57
* public String storeJson(String value);
59
* @Put("json|xml:xml|json")
60
* public Representation store(Representation value);
63
* @author Jerome Louvel
66
@Retention(RetentionPolicy.RUNTIME)
67
@Target(ElementType.METHOD)
69
public @interface Put {
72
* Specifies the media type of the request and response entities as
73
* extensions. If only one extension is provided, the extension applies to
74
* both request and response entities. If two extensions are provided,
75
* separated by a colon, then the first one is for the request entity and
76
* the second one for the response entity.<br>
78
* If several media types are supported, their extension can be specified
79
* separated by "|" characters. Note that this isn't the full MIME type
80
* value, just the extension name declared in {@link MetadataService}. For a
81
* list of all predefined extensions, please check
82
* {@link MetadataService#addCommonExtensions()}. New extension can be
84
* {@link MetadataService#addExtension(String, org.restlet.data.Metadata)}
87
* @return The media types of request and/or response entities.
89
String value() default "";