Made the GsonBuilder registerTypeHierarchyAdapter a public method.
Updated the Gson version number to 1.6 and added @since tag for the new classes
This commit is contained in:
parent
2d7367364b
commit
2b993d83b6
|
@ -4,7 +4,7 @@
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.5</version>
|
<version>1.6</version>
|
||||||
<inceptionYear>2008</inceptionYear>
|
<inceptionYear>2008</inceptionYear>
|
||||||
<name>Gson</name>
|
<name>Gson</name>
|
||||||
<url>http://code.google.com/p/google-gson/</url>
|
<url>http://code.google.com/p/google-gson/</url>
|
||||||
|
|
|
@ -429,9 +429,9 @@ public final class GsonBuilder {
|
||||||
* @param typeAdapter This object must implement at least one of the {@link InstanceCreator},
|
* @param typeAdapter This object must implement at least one of the {@link InstanceCreator},
|
||||||
* {@link JsonSerializer}, and a {@link JsonDeserializer} interfaces.
|
* {@link JsonSerializer}, and a {@link JsonDeserializer} interfaces.
|
||||||
* @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
|
* @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
|
||||||
* @since 1.5
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
GsonBuilder registerTypeHierarchyAdapter(Class<?> baseType, Object typeAdapter) {
|
public GsonBuilder registerTypeHierarchyAdapter(Class<?> baseType, Object typeAdapter) {
|
||||||
Preconditions.checkArgument(typeAdapter instanceof JsonSerializer<?>
|
Preconditions.checkArgument(typeAdapter instanceof JsonSerializer<?>
|
||||||
|| typeAdapter instanceof JsonDeserializer<?> || typeAdapter instanceof InstanceCreator<?>);
|
|| typeAdapter instanceof JsonDeserializer<?> || typeAdapter instanceof InstanceCreator<?>);
|
||||||
if (typeAdapter instanceof InstanceCreator<?>) {
|
if (typeAdapter instanceof InstanceCreator<?>) {
|
||||||
|
|
|
@ -181,6 +181,7 @@ import java.util.List;
|
||||||
* of this class are not thread safe.
|
* of this class are not thread safe.
|
||||||
*
|
*
|
||||||
* @author Jesse Wilson
|
* @author Jesse Wilson
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public final class JsonReader implements Closeable {
|
public final class JsonReader implements Closeable {
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ package com.google.gson.stream;
|
||||||
* Lexical scoping elements within a JSON reader or writer.
|
* Lexical scoping elements within a JSON reader or writer.
|
||||||
*
|
*
|
||||||
* @author Jesse Wilson
|
* @author Jesse Wilson
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
enum JsonScope {
|
enum JsonScope {
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ package com.google.gson.stream;
|
||||||
* A structure, name or value type in a JSON-encoded string.
|
* A structure, name or value type in a JSON-encoded string.
|
||||||
*
|
*
|
||||||
* @author Jesse Wilson
|
* @author Jesse Wilson
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public enum JsonToken {
|
public enum JsonToken {
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ import java.util.List;
|
||||||
* malformed JSON string will fail with an {@link IllegalStateException}.
|
* malformed JSON string will fail with an {@link IllegalStateException}.
|
||||||
*
|
*
|
||||||
* @author Jesse Wilson
|
* @author Jesse Wilson
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public final class JsonWriter implements Closeable {
|
public final class JsonWriter implements Closeable {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user