Menu

Bean to JSON PascalCase instead of camelCase

Christian
2013-03-07
2013-04-29
  • Christian

    Christian - 2013-03-07

    Hello,

    I have just started using JSON-Lib and really like using it!

    However, I do have one problem. When I create a JSON string from a class, all of the property names within the JSON object are in camelCase. How can I change this so the property names within the JSON object are in Pascal Case?

    Example Java Class:

    public class Business
    {
        private String BusinessName;

        public String getBusinessName()
        {
            return this.BusinessName;
        }
    }

    When the JSON object is created using JSONObject.fromObject(object).toString(), the 'BusinessName' property name is 'businessName'. I need it to be 'BusinessName'.

    Thank you in advance for any replies!

     
  • Christian

    Christian - 2013-03-12

    Hello?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.