Message from discussion
: Re: private setFieldNamingStrategy
Received: by 10.90.94.15 with SMTP id r15mr368421agb.4.1231528494301;
Fri, 09 Jan 2009 11:14:54 -0800 (PST)
Return-Path: <jacob.to...@gmail.com>
Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.148])
by mx.google.com with ESMTP id 7si899701yxg.8.2009.01.09.11.14.53;
Fri, 09 Jan 2009 11:14:53 -0800 (PST)
Received-SPF: pass (google.com: domain of jacob.to...@gmail.com designates 74.125.92.148 as permitted sender) client-ip=74.125.92.148;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of jacob.to...@gmail.com designates 74.125.92.148 as permitted sender) smtp.mail=jacob.to...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by qw-out-1920.google.com with SMTP id 9so4327412qwj.44
for <google-gson@googlegroups.com>; Fri, 09 Jan 2009 11:14:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:to
:subject:in-reply-to:mime-version:content-type:references;
bh=7a0VHBXJoTtcSD+y66Vcy+ND3Ln7tBkzRNK8/fYJLv8=;
b=TtQFJa/ZKcKOn7OzziNya5zEeg+JTJCzzICnSYT7JgjEvMmWxYybZ3zCn8npWAGXTj
ecR14uGp1m/A/5qIVEqaJLGdrVagdlUqkVS6ipKwP9wEG8LSXZNQTEoxhfxahKrbaSKR
LuMuMUt7RChInJO3CKdpkV+vRsKzJBoywxmAw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:date:from:to:subject:in-reply-to:mime-version
:content-type:references;
b=kTBF7aZE9QJWlcFTsr+MdQysrR40xzKL9/l2dcTEUfeM+vICbZHmWjIak6vXf1vIRr
VuJwuv5lnBFz9CeXef/Eua8ZiGqoXgBdqXHmsKhbJL+PR1AnsnSshONfeOoAjbPzSzZs
mvAMvz0PN1C5QAL35O5S00Pr9IYFWMMlApIzw=
Received: by 10.214.217.3 with SMTP id p3mr23260660qag.166.1231528492264;
Fri, 09 Jan 2009 11:14:52 -0800 (PST)
Received: by 10.214.242.9 with HTTP; Fri, 9 Jan 2009 11:14:52 -0800 (PST)
Message-ID: <373f59ea0901091114w7ae64cadr59344eb63a487b9f@mail.gmail.com>
Date: Fri, 9 Jan 2009 13:14:52 -0600
From: "Jacob Tomaw" <jacob.to...@gmail.com>
To: google-gson@googlegroups.com
Subject: Re: [google-gson:261]: Re: private setFieldNamingStrategy
In-Reply-To: <8f10b4980901091023p7b8efa74l9e09517480a7b...@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_68027_11294895.1231528492255"
References: <c9d54aaa-4897-48af-a1ce-75bbc4dd9...@o40g2000prn.googlegroups.com>
<d154e1d7-743b-4f6c-8dd7-87e53c289...@e1g2000pra.googlegroups.com>
<8f10b4980901091023p7b8efa74l9e09517480a7b...@mail.gmail.com>
------=_Part_68027_11294895.1231528492255
Content-Type: text/plain; charset=ISO-8859-1
Does the SerializedName annotation solve this?
Jacob
On Fri, Jan 9, 2009 at 12:23 PM, Brian Hawkins <brianh...@gmail.com> wrote:
> In my code I use the convention of m_varName for member variables. I would
> like a policy that removes the m_ from the variable name. Very simple
> really. And I'm also only concerned with java to json, but it would be
> pretty easy to match varName to m_varName.
>
> I understand the desire to not complicate the API, but restricting
> functionality only hinders adoption of your code. Besides any complicated
> API can be simplified via good documentation, which you have done pretty
> well at.
>
> Brian
>
>
> On Fri, Jan 9, 2009 at 10:37 AM, inder...@gmail.com <inder...@gmail.com>wrote:
>
>>
>> The primary reason we did it that way is because we did not want to
>> complicate the API.
>> Moreover, the naming policy is a tricky thing to get right since the
>> output must be valid JSON as well as Java. What policy are you looking
>> for specifically? May be you can present an example of where the
>> custom policy will be useful.
>>
>> Inder
>>
>>
>>
>>
>
> >
>
--
Jacob Tomaw
tfl:The Flatiron Life (http://tomaw.com)
Follow me on Twitter! (http://twitter.com/JacobTomaw)
------=_Part_68027_11294895.1231528492255
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Does the SerializedName annotation solve this?<br><br>Jacob<br><br><div cla=
ss=3D"gmail_quote">On Fri, Jan 9, 2009 at 12:23 PM, Brian Hawkins <span dir=
=3D"ltr"><<a href=3D"mailto:brianh...@gmail.com">brianh...@gmail.com</a>=
></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In my code I use =
the convention of m_varName for member variables. I would like a poli=
cy that removes the m_ from the variable name. Very simple really.&nb=
sp; And I'm also only concerned with java to json, but it would be pret=
ty easy to match varName to m_varName.<br>
<br>I understand the desire to not complicate the API, but restricting func=
tionality only hinders adoption of your code. Besides any complicated=
API can be simplified via good documentation, which you have done pretty w=
ell at.<br>
<font color=3D"#888888">
<br>Brian</font><div><div></div><div class=3D"Wj3C7c"><br><br><div class=3D=
"gmail_quote">On Fri, Jan 9, 2009 at 10:37 AM, <a href=3D"mailto:inder123@g=
mail.com" target=3D"_blank">inder...@gmail.com</a> <span dir=3D"ltr"><<a=
href=3D"mailto:inder...@gmail.com" target=3D"_blank">inder...@gmail.com</a=
>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
The primary reason we did it that way is because we did not want to<br>
complicate the API.<br>
Moreover, the naming policy is a tricky thing to get right since the<br>
output must be valid JSON as well as Java. What policy are you looking<br>
for specifically? May be you can present an example of where the<br>
custom policy will be useful.<br>
<br>
Inder<br>
<br>
<br>
<br>
</blockquote></div><br>
<br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Jacob Tomaw=
<br>tfl:The Flatiron Life (<a href=3D"http://tomaw.com">http://tomaw.com</a=
>)<br>Follow me on Twitter! (<a href=3D"http://twitter.com/JacobTomaw">http=
://twitter.com/JacobTomaw</a>)<br>
------=_Part_68027_11294895.1231528492255--