X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fcom%2Fgoogle%2Fgson%2Fannotations%2FSerializedName.java;fp=src%2Fcom%2Fgoogle%2Fgson%2Fannotations%2FSerializedName.java;h=0000000000000000000000000000000000000000;hb=5c86ae2f45d293408d98a291e826948052d207bc;hp=99755eb5f37a6d2466ece940c17d005dd7d597dc;hpb=5cf4714f0675349ed599707e024cf0e70fe114b2;p=unical.git diff --git a/src/com/google/gson/annotations/SerializedName.java b/src/com/google/gson/annotations/SerializedName.java deleted file mode 100644 index 99755eb..0000000 --- a/src/com/google/gson/annotations/SerializedName.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2008 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.gson.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * An annotation that indicates this member should be serialized to JSON with - * the provided name value as its field name. - * - *
This annotation will override any {@link com.google.gson.FieldNamingPolicy}, including - * the default field naming policy, that may have been set on the {@link com.google.gson.Gson} - * instance. A different naming policy can set using the {@code GsonBuilder} class. See - * {@link com.google.gson.GsonBuilder#setFieldNamingPolicy(com.google.gson.FieldNamingPolicy)} - * for more information.
- * - *Here is an example of how this annotation is meant to be used:
- *- * public class SomeClassWithFields { - * @SerializedName("name") private final String someField; - * private final String someOtherField; - * - * public SomeClassWithFields(String a, String b) { - * this.someField = a; - * this.someOtherField = b; - * } - * } - *- * - *
The following shows the output that is generated when serializing an instance of the - * above example class:
- *- * SomeClassWithFields objectToSerialize = new SomeClassWithFields("a", "b"); - * Gson gson = new Gson(); - * String jsonRepresentation = gson.toJson(objectToSerialize); - * System.out.println(jsonRepresentation); - * - * ===== OUTPUT ===== - * {"name":"a","someOtherField":"b"} - *- * - *
NOTE: The value you specify in this annotation must be a valid JSON field name.
- * - * @see com.google.gson.FieldNamingPolicy - * - * @author Inderjeet Singh - * @author Joel Leitch - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface SerializedName { - - /** - * @return the desired name of the field when it is serialized - */ - String value(); -}