diff --git a/gson/docs/javadocs/allclasses-frame.html b/gson/docs/javadocs/allclasses-frame.html index 96e9b333..747c85fe 100644 --- a/gson/docs/javadocs/allclasses-frame.html +++ b/gson/docs/javadocs/allclasses-frame.html @@ -2,10 +2,10 @@ - + -All Classes (Gson 1.3 API) +All Classes (Gson 1.4 API) @@ -21,7 +21,11 @@ All Classes (Gson 1.3 API) - + + + + + + + + + + + + - +
Expose +ExclusionStrategy +
+Expose +
+FieldAttributes
FieldNamingPolicy
@@ -55,6 +59,8 @@ All Classes (Gson 1.3 API)
JsonSerializer
+JsonStreamParser +
LongSerializationPolicy
SerializedName diff --git a/gson/docs/javadocs/allclasses-noframe.html b/gson/docs/javadocs/allclasses-noframe.html index f9c0e6ea..933cb97d 100644 --- a/gson/docs/javadocs/allclasses-noframe.html +++ b/gson/docs/javadocs/allclasses-noframe.html @@ -2,10 +2,10 @@ - + -All Classes (Gson 1.3 API) +All Classes (Gson 1.4 API) @@ -21,7 +21,11 @@ All Classes (Gson 1.3 API) - + + + + + + + + + + + + + + + + + + +
Expose +ExclusionStrategy +
+Expose +
+FieldAttributes
FieldNamingPolicy
@@ -55,6 +59,8 @@ All Classes (Gson 1.3 API)
JsonSerializer
+JsonStreamParser +
LongSerializationPolicy
SerializedName diff --git a/gson/docs/javadocs/com/google/gson/FieldNamingPolicy.html b/gson/docs/javadocs/com/google/gson/FieldNamingPolicy.html index ed313ebc..b90aa810 100644 --- a/gson/docs/javadocs/com/google/gson/FieldNamingPolicy.html +++ b/gson/docs/javadocs/com/google/gson/FieldNamingPolicy.html @@ -2,10 +2,10 @@ - + -FieldNamingPolicy (Gson 1.3 API) +FieldNamingPolicy (Gson 1.4 API) @@ -15,7 +15,7 @@ FieldNamingPolicy (Gson 1.3 API)
LOWER_CASE_WITH_DASHES + +
+          Using this naming policy with Gson will modify the Java Field name from its camel cased + form to a lower case field name where each word is separated by a dash (-).
LOWER_CASE_WITH_UNDERSCORES
@@ -236,6 +243,33 @@ public static final +
+ +

+LOWER_CASE_WITH_DASHES

+
+public static final FieldNamingPolicy LOWER_CASE_WITH_DASHES
+
+
Using this naming policy with Gson will modify the Java Field name from its camel cased + form to a lower case field name where each word is separated by a dash (-). + +

Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":

+
    +
  • someFieldName ---> some-field-name
  • +
  • _someFieldName ---> _some-field-name
  • +
  • aStringField ---> a-string-field
  • +
  • aURL ---> a-u-r-l
  • +
+ Using dashes in JavaScript is not recommended since dash is also used for a minus sign in + expressions. This requires that a field named with dashes is always accessed as a quoted + property like myobject['my-field']. Accessing it as an object field + myobject.my-field will result in an unintended javascript expression. +

+

+
Since:
+
1.4
+
+
@@ -317,7 +351,7 @@ with the specified name
 StringtoJson(JsonElement jsonElement) + +
+          Converts a tree of JsonElements into its equivalent JSON representation.
+ voidtoJson(JsonElement jsonElement, + Appendable writer) + +
+          Writes out the equivalent JSON for a tree of JsonElements.
+ String toJson(Object src)
@@ -309,6 +326,25 @@ This is the main class for using Gson. Gson is typically used by first construct
+ JsonElementtoJsonTree(Object src) + +
+          This method serializes the specified object into its equivalent representation as a tree of + JsonElements.
+ JsonElementtoJsonTree(Object src, + Type typeOfSrc) + +
+          This method serializes the specified object, including those of generic types, into its + equivalent representation as a tree of JsonElements.
 String toString() @@ -358,7 +394,7 @@ public Gson() BigDecimal, and BigInteger classes. If you would prefer to change the default representation, you can do so by registering a type adapter through GsonBuilder.registerTypeAdapter(Type, Object). -
  • The default Date format is same as DateFormat.DEFAULT. This format +
  • The default Date format is same as DateFormat.DEFAULT. This format ignores the millisecond portion of the date during serialization. You can change this by invoking GsonBuilder.setDateFormat(int) or GsonBuilder.setDateFormat(String).
  • @@ -388,6 +424,53 @@ public Gson()
    +

    +toJsonTree

    +
    +public JsonElement toJsonTree(Object src)
    +
    +
    This method serializes the specified object into its equivalent representation as a tree of + JsonElements. This method should be used when the specified object is not a generic + type. This method uses Object.getClass() to get the type for the specified object, but + the getClass() loses the generic type information because of the Type Erasure feature + of Java. Note that this method works fine if the any of the object fields are of generic type, + just the object itself should not be of a generic type. If the object is of generic type, use + toJsonTree(Object, Type) instead. +

    +

    +
    Parameters:
    src - the object for which Json representation is to be created setting for Gson +
    Returns:
    Json representation of src.
    Since:
    +
    1.4
    +
    +
    +
    +
    + +

    +toJsonTree

    +
    +public JsonElement toJsonTree(Object src,
    +                              Type typeOfSrc)
    +
    +
    This method serializes the specified object, including those of generic types, into its + equivalent representation as a tree of JsonElements. This method must be used if the + specified object is a generic type. For non-generic objects, use toJsonTree(Object) + instead. +

    +

    +
    Parameters:
    src - the object for which JSON representation is to be created
    typeOfSrc - The specific genericized type of src. You can obtain + this type by using the TypeToken class. For example, + to get the type for Collection<Foo>, you should use: +
    + Type typeOfSrc = new TypeToken<Collection<Foo>>(){}.getType();
    + 
    +
    Returns:
    Json representation of src
    Since:
    +
    1.4
    +
    +
    +
    +
    +

    toJson

    @@ -478,6 +561,38 @@ public void toJson(

    +toJson

    +
    +public String toJson(JsonElement jsonElement)
    +
    +
    Converts a tree of JsonElements into its equivalent JSON representation. +

    +

    +
    Parameters:
    jsonElement - root of a tree of JsonElements +
    Returns:
    JSON String representation of the tree
    Since:
    +
    1.4
    +
    +
    +
    +
    + +

    +toJson

    +
    +public void toJson(JsonElement jsonElement,
    +                   Appendable writer)
    +
    +
    Writes out the equivalent JSON for a tree of JsonElements. +

    +

    +
    Parameters:
    jsonElement - root of a tree of JsonElements
    writer - Writer to which the Json representation needs to be written
    Since:
    +
    1.4
    +
    +
    +
    +
    +

    fromJson

    @@ -602,7 +717,7 @@ public <T> T fromJson(fromJson(JsonElement, Type).
     

    -
    Type Parameters:
    T - the type of the desired object
    Parameters:
    json - the root of the parse tree of JsonElements from which the object is to +
    Type Parameters:
    T - the type of the desired object
    Parameters:
    json - the root of the parse tree of JsonElements from which the object is to be deserialized
    classOfT - The class of T
    Returns:
    an object of type T from the json
    Throws: @@ -625,7 +740,7 @@ public <T> T fromJson(fromJson(JsonElement, Class) instead.

    -
    Type Parameters:
    T - the type of the desired object
    Parameters:
    json - the root of the parse tree of JsonElements from which the object is to +
    Type Parameters:
    T - the type of the desired object
    Parameters:
    json - the root of the parse tree of JsonElements from which the object is to be deserialized
    typeOfT - The specific genericized type of src. You can obtain this type by using the TypeToken class. For example, to get the type for Collection<Foo>, you should use: diff --git a/gson/docs/javadocs/com/google/gson/GsonBuilder.html b/gson/docs/javadocs/com/google/gson/GsonBuilder.html index 4e0a252e..33cda532 100644 --- a/gson/docs/javadocs/com/google/gson/GsonBuilder.html +++ b/gson/docs/javadocs/com/google/gson/GsonBuilder.html @@ -2,10 +2,10 @@ - + -GsonBuilder (Gson 1.3 API) +GsonBuilder (Gson 1.4 API) @@ -15,7 +15,7 @@ GsonBuilder (Gson 1.3 API)
     GsonBuildersetExclusionStrategies(ExclusionStrategy... strategies) + +
    +          Configures Gson to apply a set of exclusion strategies during both serialization and + deserialization.
    + GsonBuilder setFieldNamingPolicy(FieldNamingPolicy namingConvention)
    @@ -384,8 +393,8 @@ generateNonExecutableJson public GsonBuilder generateNonExecutableJson()
    Makes the output JSON non-executable in Javascript by prefixing the generated JSON with some - special text. This prevents attacks from third-party sites through script sourcing. See - Gson Issue 42 + special text. This prevents attacks from third-party sites through script sourcing. See + Gson Issue 42 for details.

    @@ -495,6 +504,25 @@ public

    +setExclusionStrategies

    +
    +public GsonBuilder setExclusionStrategies(ExclusionStrategy... strategies)
    +
    +
    Configures Gson to apply a set of exclusion strategies during both serialization and + deserialization. Each of the strategies will be applied as a disjunction rule. + This means that if one of the strategies suggests that a field (or class) should be + skipped then that field (or object) is skipped during serializaiton/deserialization. +

    +

    +
    Parameters:
    strategies - the set of strategy object to apply during object (de)serialization. +
    Returns:
    a reference to this GsonBuilder object to fulfill the "Builder" pattern
    Since:
    +
    1.4
    +
    +
    +
    +
    +

    setPrettyPrinting

    diff --git a/gson/docs/javadocs/com/google/gson/InstanceCreator.html b/gson/docs/javadocs/com/google/gson/InstanceCreator.html
    index 7ad64e16..4a8e650f 100644
    --- a/gson/docs/javadocs/com/google/gson/InstanceCreator.html
    +++ b/gson/docs/javadocs/com/google/gson/InstanceCreator.html
    @@ -2,10 +2,10 @@
     
     
     
    -
    +
     
     
    -InstanceCreator (Gson 1.3 API)
    +InstanceCreator (Gson 1.4 API)
     
     
     
    @@ -15,7 +15,7 @@ InstanceCreator (Gson 1.3 API)
     
     

    -A class representing an object type in Json. An object consists of name-value pairs where names - are strings, and values are any other type of JsonElement. This allows for a creating a +A class representing an object type in Json. An object consists of name-value pairs where names + are strings, and values are any other type of JsonElement. This allows for a creating a tree of JsonElements. The member elements of this object are maintained in order they were added.

    @@ -328,7 +328,7 @@ addProperty public void addProperty(String property, String value)

    -
    Convenience method to add a primitive member. The specified value is converted to a +
    Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of String.

    @@ -343,7 +343,7 @@ addProperty public void addProperty(String property, Number value)
    -
    Convenience method to add a primitive member. The specified value is converted to a +
    Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of Number.

    @@ -358,7 +358,7 @@ addProperty public void addProperty(String property, Boolean value)
    -
    Convenience method to add a boolean member. The specified value is converted to a +
    Convenience method to add a boolean member. The specified value is converted to a JsonPrimitive of Boolean.

    @@ -373,7 +373,7 @@ addProperty public void addProperty(String property, Character value)
    -
    Convenience method to add a char member. The specified value is converted to a +
    Convenience method to add a char member. The specified value is converted to a JsonPrimitive of Character.

    @@ -387,7 +387,7 @@ entrySet
     public Set<Map.Entry<String,JsonElement>> entrySet()
    -
    Returns a set of members of this object. The set is ordered, and the order is in which the +
    Returns a set of members of this object. The set is ordered, and the order is in which the elements were added.

    diff --git a/gson/docs/javadocs/com/google/gson/JsonParseException.html b/gson/docs/javadocs/com/google/gson/JsonParseException.html index 165d2825..ab214aae 100644 --- a/gson/docs/javadocs/com/google/gson/JsonParseException.html +++ b/gson/docs/javadocs/com/google/gson/JsonParseException.html @@ -2,10 +2,10 @@ - + -JsonParseException (Gson 1.3 API) +JsonParseException (Gson 1.4 API) @@ -15,7 +15,7 @@ JsonParseException (Gson 1.3 API)
    + booleanequals(Object obj) + +
    +           
     BigDecimal getAsBigDecimal() @@ -254,6 +262,14 @@ A class representing a Json primitive value. A primitive value
    + inthashCode() + +
    +           
     boolean isBoolean() @@ -292,7 +308,7 @@ A class representing a Json primitive value. A primitive value Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetClass, notify, notifyAll, wait, wait, wait
      @@ -632,6 +648,34 @@ public char getAsCharacter()
    Returns:
    get this element as a primitive char value.
    +
    + +

    +hashCode

    +
    +public int hashCode()
    +
    +
    +
    Overrides:
    hashCode in class Object
    +
    +
    +
    +
    +
    +
    + +

    +equals

    +
    +public boolean equals(Object obj)
    +
    +
    +
    Overrides:
    equals in class Object
    +
    +
    +
    +
    +

    diff --git a/gson/docs/javadocs/com/google/gson/JsonSerializationContext.html b/gson/docs/javadocs/com/google/gson/JsonSerializationContext.html index d43e07b0..83c08f15 100644 --- a/gson/docs/javadocs/com/google/gson/JsonSerializationContext.html +++ b/gson/docs/javadocs/com/google/gson/JsonSerializationContext.html @@ -2,10 +2,10 @@ - + -JsonSerializationContext (Gson 1.3 API) +JsonSerializationContext (Gson 1.4 API) @@ -15,7 +15,7 @@ JsonSerializationContext (Gson 1.3 API)