-
Notifications
You must be signed in to change notification settings - Fork 0
kunle/Force.com-Apex-JsonWriter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
README ====== This library allows you to easily write JSON in APEX scripting language of Force.com For more on Apex goto http://developer.force.com Example usage: String expectedResult = '{'+ '"To":"[email protected]",'+ '"From":"James Bond <[email protected]>",'+ '"ReplyTo":"James Bond<[email protected]>",'+ '"Subject":"This is an invitation test",'+ '"HtmlBody":"<b>Hello, Kunle</b> <br/> We are sending you this test invite",'+ '"Integer":1000,'+ '"Decimal":15.344,'+ '"Boolean":true,'+ '"Double":2.2'+ '}'; List<JSONNameValuePair> jsonBodyMemebers = new List<JSONNameValuePair>(); Double x = 2.2; jsonBodyMemebers.add(new JSONNameValuePair('To','[email protected]')); jsonBodyMemebers.add(new JSONNameValuePair('From','James Bond <[email protected]>')); jsonBodyMemebers.add(new JSONNameValuePair('ReplyTo','James Bond<[email protected]>')); jsonBodyMemebers.add(new JSONNameValuePair('Subject','This is an invitation test')); jsonBodyMemebers.add(new JSONNameValuePair('HtmlBody','<b>Hello, Kunle</b> <br/> We are sending you this test invite')); jsonBodyMemebers.add(new JSONNameValuePair('Integer',1000)); jsonBodyMemebers.add(new JSONNameValuePair('Decimal',15.344)); jsonBodyMemebers.add(new JSONNameValuePair('Boolean',true)); jsonBodyMemebers.add(new JSONNameValuePair('Double',x)); JSONNameValuePair.returnJsonMembersString(jsonBodyMemebers); String body = JSONNameValuePair.returnJsonMembersString(jsonBodyMemebers); system.assert(body == expectedResult); Dependencies: Class is selfcontained. It has 93% test coverage Note: There are no validations. I plan to put these in when I get the time
About
Class for writing JSON using Apex scripting language for Salesforce's force.com platform
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published