a1bcd58bf1046e26f586ad8c0563c6326e66fe26
[jalview.git] / src / org / json / JSONPropertyName.java
1 package org.json;
2
3 /*
4 Copyright (c) 2018 JSON.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15
16 The Software shall be used for Good, not Evil.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25 */
26
27 import static java.lang.annotation.ElementType.METHOD;
28 import static java.lang.annotation.RetentionPolicy.RUNTIME;
29
30 import java.lang.annotation.Documented;
31 import java.lang.annotation.Retention;
32 import java.lang.annotation.Target;
33
34 @Documented
35 @Retention(RUNTIME)
36 @Target({METHOD})
37 /**
38  * Use this annotation on a getter method to override the Bean name
39  * parser for Bean -&gt; JSONObject mapping. A value set to empty string <code>""</code>
40  * will have the Bean parser fall back to the default field name processing.
41  */
42 public @interface JSONPropertyName {
43     /**
44      * @return The name of the property as to be used in the JSON Object.
45      */
46     String value();
47 }