<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">java.lang.Object</A>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true"title="class or interface in java.lang">java.lang.Enum</A><<AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A>>
<DT><B>All Implemented Interfaces:</B><DD><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html?is-external=true"title="class or interface in java.io">Serializable</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html?is-external=true"title="class or interface in java.lang">Comparable</A><<AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A>></DD>
<DT><PRE>public enum <B>FieldNamingPolicy</B><DT>extends <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true"title="class or interface in java.lang">Enum</A><<AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A>></DL>
An enumeration that defines a few standard naming conventions for JSON field names.
This enumeration should be used in conjunction with <AHREF="../../../com/google/gson/GsonBuilder.html"title="class in com.google.gson"><CODE>GsonBuilder</CODE></A>
to configure a <AHREF="../../../com/google/gson/Gson.html"title="class in com.google.gson"><CODE>Gson</CODE></A> instance to properly translate Java field
<TD><CODE><B><AHREF="../../../com/google/gson/FieldNamingPolicy.html#valueOf(java.lang.String)">valueOf</A></B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> name)</CODE>
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true"title="class or interface in java.lang">Enum</A></B></TH>
<TD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#compareTo(E)"title="class or interface in java.lang">compareTo</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#equals(java.lang.Object)"title="class or interface in java.lang">equals</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#getDeclaringClass()"title="class or interface in java.lang">getDeclaringClass</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#hashCode()"title="class or interface in java.lang">hashCode</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#name()"title="class or interface in java.lang">name</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#ordinal()"title="class or interface in java.lang">ordinal</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#toString()"title="class or interface in java.lang">toString</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html?is-external=true#valueOf(java.lang.Class, java.lang.String)"title="class or interface in java.lang">valueOf</A></CODE></TD>
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></B></TH>
<TD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()"title="class or interface in java.lang">getClass</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()"title="class or interface in java.lang">notify</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()"title="class or interface in java.lang">notifyAll</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()"title="class or interface in java.lang">wait</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)"title="class or interface in java.lang">wait</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)"title="class or interface in java.lang">wait</A></CODE></TD>
public static final <AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A><B>UPPER_CAMEL_CASE</B></PRE>
<DL>
<DD>Using this naming policy with Gson will ensure that the first "letter" of the Java
field name is capitalized when serialized to its JSON form.
<p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
public static final <AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A><B>UPPER_CAMEL_CASE_WITH_SPACES</B></PRE>
<DL>
<DD>Using this naming policy with Gson will ensure that the first "letter" of the Java
field name is capitalized when serialized to its JSON form and the words will be
separated by a space.
<p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
public static final <AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A><B>LOWER_CASE_WITH_UNDERSCORES</B></PRE>
<DL>
<DD>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 an underscore (_).
<p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
<ul>
<li>someFieldName ---> some_field_name</li>
<li>_someFieldName ---> _some_field_name</li>
<li>aStringField ---> a_string_field</li>
<li>aURL ---> a_u_r_l</li>
</ul>
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="LOWER_CASE_WITH_DASHES"><!----></A><H3>
LOWER_CASE_WITH_DASHES</H3>
<PRE>
public static final <AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A><B>LOWER_CASE_WITH_DASHES</B></PRE>
<DL>
<DD>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 (-).
<p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
<ul>
<li>someFieldName ---> some-field-name</li>
<li>_someFieldName ---> _some-field-name</li>
<li>aStringField ---> a-string-field</li>
<li>aURL ---> a-u-r-l</li>
</ul>
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 <code>myobject['my-field']</code>. Accessing it as an object field
<code>myobject.my-field</code> will result in an unintended javascript expression.
public static <AHREF="../../../com/google/gson/FieldNamingPolicy.html"title="enum in com.google.gson">FieldNamingPolicy</A><B>valueOf</B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> name)</PRE>
<DD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true"title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if this enum type has no constant
with the specified name
<DD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.html?is-external=true"title="class or interface in java.lang">NullPointerException</A></CODE> - if the argument is null</DL>