Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
private setFieldNamingStrategy
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
brianhks  
View profile  
 More options Jan 9, 12:28 pm
From: brianhks <brianh...@gmail.com>
Date: Fri, 9 Jan 2009 09:28:51 -0800 (PST)
Local: Fri, Jan 9 2009 12:28 pm
Subject: private setFieldNamingStrategy
The design decision for why you use setFieldNamingPolicy and pass an
enum is beyond me.  How do I pass a custom naming policy?  Why have
you set it up to pass an enum instead of an interface?

It seems to me, the correct way of implementing this would be to make
setFieldNamingStrategy public, along with the matching interface, so I
can easily customize the naming policy/strategy.

It is open source so I can build it myself with the above changes, but
I am curios as to why it was made this way?

Brian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inder123@gmail.com  
View profile  
 More options Jan 9, 12:37 pm
From: "inder...@gmail.com" <inder...@gmail.com>
Date: Fri, 9 Jan 2009 09:37:38 -0800 (PST)
Local: Fri, Jan 9 2009 12:37 pm
Subject: Re: private setFieldNamingStrategy
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to ": Re: private setFieldNamingStrategy" by Brian Hawkins
Brian Hawkins  
View profile  
 More options Jan 9, 1:23 pm
From: "Brian Hawkins" <brianh...@gmail.com>
Date: Fri, 9 Jan 2009 11:23:02 -0700
Local: Fri, Jan 9 2009 1:23 pm
Subject: Re: [google-gson:260]: Re: private setFieldNamingStrategy

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Tomaw  
View profile  
 More options Jan 9, 2:14 pm
From: "Jacob Tomaw" <jacob.to...@gmail.com>
Date: Fri, 9 Jan 2009 13:14:52 -0600
Local: Fri, Jan 9 2009 2:14 pm
Subject: Re: [google-gson:261]: Re: private setFieldNamingStrategy

Does the SerializedName annotation solve this?

Jacob

--
Jacob Tomaw
tfl:The Flatiron Life (http://tomaw.com)
Follow me on Twitter! (http://twitter.com/JacobTomaw)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Hawkins  
View profile  
 More options Jan 9, 3:09 pm
From: "Brian Hawkins" <brianh...@gmail.com>
Date: Fri, 9 Jan 2009 13:09:04 -0700
Local: Fri, Jan 9 2009 3:09 pm
Subject: Re: [google-gson:262]: Re: private setFieldNamingStrategy

Write a small class of maybe 10 lines or add annotations to variables in 80+
files?  I think I'll go with 10 lines of code.

Brian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inder123@gmail.com  
View profile  
 More options Jan 9, 11:11 pm
From: "inder...@gmail.com" <inder...@gmail.com>
Date: Fri, 9 Jan 2009 20:11:31 -0800 (PST)
Local: Fri, Jan 9 2009 11:11 pm
Subject: Re: : Re: private setFieldNamingStrategy
Hi Brian,

Just to set some expectations: we are very close to release a version
of Gson 1.3 (probably beta) and would not like to add any more feature
at this time. However, we will start a discussion on the design of
this feature to get some feedback from the group before finalizing
it.

So, in the short term you have the option of modifying Gson's source-
code or following Jacob's suggestion.

Inder


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inder123@gmail.com  
View profile  
 More options Jan 9, 11:14 pm
From: "inder...@gmail.com" <inder...@gmail.com>
Date: Fri, 9 Jan 2009 20:14:19 -0800 (PST)
Local: Fri, Jan 9 2009 11:14 pm
Subject: Re: : Re: private setFieldNamingStrategy
I entered a feature request on this topic at
http://code.google.com/p/google-gson/issues/detail?id=91

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google