~ubuntu-branches/ubuntu/saucy/restlet/saucy

« back to all changes in this revision

Viewing changes to org.restlet/src/org/restlet/resource/Put.java

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 16:25:45 UTC
  • Revision ID: package-import@ubuntu.com-20120611162545-5w2o0resi5y3pybc
Tags: upstream-2.0.14
ImportĀ upstreamĀ versionĀ 2.0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright 2005-2012 Restlet S.A.S.
 
3
 * 
 
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.
 
8
 * 
 
9
 * You can obtain a copy of the Apache 2.0 license at
 
10
 * http://www.opensource.org/licenses/apache-2.0
 
11
 * 
 
12
 * You can obtain a copy of the LGPL 3.0 license at
 
13
 * http://www.opensource.org/licenses/lgpl-3.0
 
14
 * 
 
15
 * You can obtain a copy of the LGPL 2.1 license at
 
16
 * http://www.opensource.org/licenses/lgpl-2.1
 
17
 * 
 
18
 * You can obtain a copy of the CDDL 1.0 license at
 
19
 * http://www.opensource.org/licenses/cddl1
 
20
 * 
 
21
 * You can obtain a copy of the EPL 1.0 license at
 
22
 * http://www.opensource.org/licenses/eclipse-1.0
 
23
 * 
 
24
 * See the Licenses for the specific language governing permissions and
 
25
 * limitations under the Licenses.
 
26
 * 
 
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
 
30
 * 
 
31
 * Restlet is a registered trademark of Restlet S.A.S.
 
32
 */
 
33
 
 
34
package org.restlet.resource;
 
35
 
 
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;
 
41
 
 
42
import org.restlet.engine.Method;
 
43
import org.restlet.service.MetadataService;
 
44
 
 
45
/**
 
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>
 
49
 * <br>
 
50
 * Example:
 
51
 * 
 
52
 * <pre>
 
53
 * &#064;Put
 
54
 * public MyOutputBean store(MyInputBean input);
 
55
 * 
 
56
 * &#064;Put(&quot;json&quot;)
 
57
 * public String storeJson(String value);
 
58
 * 
 
59
 * &#064;Put(&quot;json|xml:xml|json&quot;)
 
60
 * public Representation store(Representation value);
 
61
 * </pre>
 
62
 * 
 
63
 * @author Jerome Louvel
 
64
 */
 
65
@Documented
 
66
@Retention(RetentionPolicy.RUNTIME)
 
67
@Target(ElementType.METHOD)
 
68
@Method("PUT")
 
69
public @interface Put {
 
70
 
 
71
    /**
 
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>
 
77
     * <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
 
83
     * registered using
 
84
     * {@link MetadataService#addExtension(String, org.restlet.data.Metadata)}
 
85
     * method.
 
86
     * 
 
87
     * @return The media types of request and/or response entities.
 
88
     */
 
89
    String value() default "";
 
90
 
 
91
}