Thread: Re: [json-lib-user] Quick Question on JSON
Brought to you by:
aalmiray
From: Andres A. <aal...@ya...> - 2007-12-11 20:27:18
|
Hi Haritha,=0A=0AAre you sure the contents of the named property ('JSON') a= re not automatically converted into a JSONObject ? it looks to me like it i= s a well formed json string, if so it should be converted automatically whe= n you call fromObject() at top level.=0A=0ACan you please tell us which ver= sion of Json-lib are you testing with?=0A=0ARegards,=0AAndres=0A=0A----- Or= iginal Message ----=0AFrom: Haritha Juturu <har...@ya...>=0ATo:= jso...@li...=0ASent: Tuesday, December 11, 2007 12:= 16:36 PM=0ASubject: [json-lib-user] Quick Question on JSON=0A=0A=0AHi Every= one=0AI have a line of code=0AJSONObject jsonObj =3D JSONObject.fromObject(= textField, jsonConfig ); =0Awhich produces this JSON string=0A=0A{"parent= Id":678,"textFieldId":111,=0A"JSON":=0A"{'sizeWidth':620,'text':'=93[Winnin= g the Nobel Peace Prize]','positionLeft':20,'style':'left:20px;top:100px;wi= dth:620px;height:100px;','positionTop':100,'name':'','cssClass':'','objectT= ype':'TextObject','sizeHeight':100}"=0A}=0A=0Anow if i want the property "j= son" whose value is a string=0A =93[Winning the Nobel Peace=0APrize]','posi= tionLeft':20,'style':'left:20px;top:100px;width:620px;height:100px;','posit= ionTop':100,'name':'','cssClass':'','objectType':'TextObject','sizeHeight':= 100}"=0A=0Ato be converted to a json object .... is there any API methods i= can use.i am unable to locate any.=0A=0Ai.e my output should look like = =0A{"parentId":678,"textFieldId":111,=0A"JSON": this value is not a string = anymore=0A{'sizeWidth':620,'text':'=93[Winning=0Athe Nobel Peace=0APrize]',= 'positionLeft':20,'style':'left:20px;top:100px;width:620px;height:100px;','= positionTop':100,'name':'','cssClass':'','objectType':'TextObject','sizeHei= ght':100}=0A}=0A=0AI have a constraint that i need to do this manipulation = on the jsonObj .=0A=0AThanks=0AHaritha=0A=0A=0A=0A=0A=0A=0A Be a bette= r friend, newshound, and =0Aknow-it-all with Yahoo! Mobile. Try it now.=0A= =0A=0A=0A=0A=0A ______________________________________________________= ______________________________=0ABe a better friend, newshound, and =0Aknow= -it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=3DA= hu06i62sR8HDtDypao8Wcj9tAcJ =0A |
From: Haritha J. <har...@ya...> - 2007-12-11 21:00:06
|
Hi Andres=0A=0AThe TextField bean looks like this=0Apublic class TextField(= ){ =0A private Long parentId;=0A private Long textFieldId;=0A priva= te String JSON;=0A}=0A=0AAfter executing the code JSONObject jsonObj =3D JS= ONObject.fromObject( textField, jsonConfig ); , i try to print this object= 'jsonObj" and it prints the name value pair( of JSON Property) with quotes= =0A=0A{"parentId":678,"textFieldId":111,"JSON":"{'sizeWidth':620,'text':'= =93[Winning the Nobel Peace Prize] ','positionLeft':20,'style':'left:20px;t= op:100px;width:620px;height:100px;','positionTop':100,'name':'','cssClass':= '','objectType':'TextObject','sizeHeight':100}"}=0A=0AIf it was converting = this 'JSON' property to JSONObject internally, wont it print as=0A=0A"JSON"= :=0A{"parentId":678,"textFieldId":111,"JSON":{'sizeWidth':620,'text':'=93[W= inning=0Athe Nobel Peace Prize]=0A','positionLeft':20,'style':'left:20px;to= p:100px;width:620px;height:100px;','positionTop':100,'name':'','cssClass':'= ','objectType':'TextObject','sizeHeight':100}}=0Awithout the quotes on the = value.=0A=0APlease correct me if i got it wrong=0A=0AI am using the json-li= b-2.1 for jsd 1.5 version.=0AHaritha=0A=0A=0A=0A----- Original Message ----= =0AFrom: Andres Almiray <aal...@ya...>=0ATo: Haritha Juturu <haritha.= ju...@ya...>; jso...@li...=0ASent: Tuesday, Dec= ember 11, 2007 12:27:12 PM=0ASubject: Re: [json-lib-user] Quick Question on= JSON=0A=0A=0AHi Haritha,=0A=0AAre you sure the contents of the named prope= rty ('JSON') are not automatically converted into a JSONObject ? it looks t= o me like it is a well formed json string, if so it should be converted aut= omatically when you call fromObject() at top level.=0A=0ACan you please tel= l us which version of Json-lib are you testing with?=0A=0ARegards,=0AAndres= =0A=0A----- Original Message ----=0AFrom: Haritha Juturu <haritha.juturu@ya= hoo.com>=0ATo: jso...@li...=0ASent: Tuesday, Decembe= r 11, 2007 12:16:36 PM=0ASubject: [json-lib-user] Quick Question on JSON=0A= =0A=0AHi Everyone=0AI have a line of code=0AJSONObject jsonObj =3D JSONObje= ct.fromObject( textField, jsonConfig ); =0Awhich produces this JSON string= =0A=0A{"parentId":678,"textFieldId":111,=0A"JSON":=0A"{'sizeWidth':620,'tex= t':'=93[Winning the Nobel Peace Prize]','positionLeft':20,'style':'left:20p= x;top:100px;width:620px;height:100px;','positionTop':100,'name':'','cssClas= s':'','objectType':'TextObject','sizeHeight':100}"=0A}=0A=0Anow if i want t= he property "json" whose value is a string=0A =93[Winning the Nobel Peace= =0APrize]','positionLeft':20,'style':'left:20px;top:100px;width:620px;heigh= t:100px;','positionTop':100,'name':'','cssClass':'','objectType':'TextObjec= t','sizeHeight':100}"=0A=0Ato be converted to a json object .... is there a= ny API methods i can use.i am unable to locate any.=0A=0Ai.e my output sho= uld look like =0A{"parentId":678,"textFieldId":111,=0A"JSON": this value is= not a string anymore=0A{'sizeWidth':620,'text':'=93[Winning=0Athe Nobel Pe= ace=0APrize]','positionLeft':20,'style':'left:20px;top:100px;width:620px;he= ight:100px;','positionTop':100,'name':'','cssClass':'','objectType':'TextOb= ject','sizeHeight':100}=0A}=0A=0AI have a constraint that i need to do this= manipulation on the jsonObj .=0A=0AThanks=0AHaritha=0A=0A=0A=0A=0A=0A=0A = Be a better friend, newshound, and =0Aknow-it-all with Yahoo! Mobile. = Try it now.=0A=0A=0A=0A=0A=0A Be a better friend, newshound, and =0Akn= ow-it-all with Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A=0A _________= ___________________________________________________________________________= =0ANever miss a thing. Make Yahoo your home page. =0Ahttp://www.yahoo.com/= r/hs |
From: Andres A. <aal...@ya...> - 2007-12-11 21:04:27
|
Hi Haritha,=0A=0AYou are right, if it is a nested JSONObject it should prin= t it without the surrounding double quotes. As a last resort, can you call= =0A=0AJSONObject jsonObj =3D JSONObject.fromObject( textField, jsonConfig )= ;=0AJSONObject json =3D json.getJSONObject( "JSON" );=0A=0AIf it really is = a JSONObject then no exception should arise. If no exception is thrown then= there may be something going on with the string representation of a JSONOb= ject when printed.=0A=0AThanks,=0AAndres=0A=0A=0A----- Original Message ---= -=0AFrom: Haritha Juturu <har...@ya...>=0ATo: Andres Almiray <a= al...@ya...>; jso...@li...=0ASent: Tuesday, De= cember 11, 2007 12:59:32 PM=0ASubject: Re: [json-lib-user] Quick Question o= n JSON=0A=0A=0AHi Andres=0A=0AThe TextField bean looks like this=0Apublic c= lass TextField(){ =0A private Long parentId;=0A private Long textField= Id;=0A private String JSON;=0A}=0A=0AAfter executing the code JSONObject= jsonObj =3D JSONObject.fromObject( textField, jsonConfig ); , i try to pr= int this object 'jsonObj" and it prints the name value pair( of JSON Proper= ty) with quotes=0A=0A{"parentId":678,"textFieldId":111,"JSON":"{'sizeWidth'= :620,'text':'=93[Winning the Nobel Peace Prize]=0A ','positionLeft':20,'sty= le':'left:20px;top:100px;width:620px;height:100px;','positionTop':100,'name= ':'','cssClass':'','objectType':'TextObject','sizeHeight':100}"}=0A=0AIf it= was converting this 'JSON' property to JSONObject internally, wont it prin= t as=0A=0A"JSON":=0A{"parentId":678,"textFieldId":111,"JSON":{'sizeWidth':6= 20,'text':'=93[Winning=0Athe Nobel Peace Prize]=0A','positionLeft':20,'styl= e':'left:20px;top:100px;width:620px;height:100px;','positionTop':100,'name'= :'','cssClass':'','objectType':'TextObject','sizeHeight':100}}=0Awithout th= e quotes on the value.=0A=0APlease correct me if i got it wrong=0A=0AI am u= sing the json-lib-2.1 for jsd 1.5 version.=0AHaritha=0A=0A=0A=0A----- Origi= nal Message ----=0AFrom: Andres Almiray <aal...@ya...>=0ATo: Haritha = Juturu <har...@ya...>; jso...@li...=0ASe= nt: Tuesday, December 11, 2007 12:27:12 PM=0ASubject: Re: [json-lib-user] Q= uick Question on JSON=0A=0A=0AHi Haritha,=0A=0AAre you sure the contents of= the named property ('JSON') are not automatically converted into a JSONObj= ect ? it looks to me like it is a well formed json string, if so it should = be converted automatically when you call fromObject() at top level.=0A=0ACa= n you please tell us which version of Json-lib are you testing with?=0A=0AR= egards,=0AAndres=0A=0A----- Original Message ----=0AFrom: Haritha Juturu <h= ari...@ya...>=0ATo: jso...@li...=0ASent: = Tuesday, December 11, 2007 12:16:36 PM=0ASubject: [json-lib-user] Quick Que= stion on JSON=0A=0A=0AHi Everyone=0AI have a line of code=0AJSONObject json= Obj =3D JSONObject.fromObject( textField, jsonConfig ); =0Awhich produces = this JSON string=0A=0A{"parentId":678,"textFieldId":111,=0A"JSON":=0A"{'siz= eWidth':620,'text':'=93[Winning the Nobel Peace Prize]','positionLeft':20,'= style':'left:20px;top:100px;width:620px;height:100px;','positionTop':100,'n= ame':'','cssClass':'','objectType':'TextObject','sizeHeight':100}"=0A}=0A= =0Anow if i want the property "json" whose value is a string=0A =93[Winning= the Nobel Peace=0APrize]','positionLeft':20,'style':'left:20px;top:100px;w= idth:620px;height:100px;','positionTop':100,'name':'','cssClass':'','object= Type':'TextObject','sizeHeight':100}"=0A=0Ato be converted to a json object= .... is there any API methods i can use.i am unable to locate any.=0A=0Ai.= e my output should look like =0A{"parentId":678,"textFieldId":111,=0A"JSON= ": this value is not a string anymore=0A{'sizeWidth':620,'text':'=93[Winnin= g=0Athe Nobel Peace=0APrize]','positionLeft':20,'style':'left:20px;top:100p= x;width:620px;height:100px;','positionTop':100,'name':'','cssClass':'','obj= ectType':'TextObject','sizeHeight':100}=0A}=0A=0AI have a constraint that i= need to do this manipulation on the jsonObj .=0A=0AThanks=0AHaritha=0A=0A= =0A=0A=0A=0A=0A Be a better friend, newshound, and =0Aknow-it-all with= Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A=0A Be a better friend, new= shound, and =0Aknow-it-all with Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A= =0A Looking for last minute shopping deals? =0AFind them fast with Ya= hoo! Search.=0A=0A=0A=0A=0A=0A _______________________________________= _____________________________________________=0ABe a better friend, newshou= nd, and =0Aknow-it-all with Yahoo! Mobile. Try it now. http://mobile.yaho= o.com/;_ylt=3DAhu06i62sR8HDtDypao8Wcj9tAcJ =0A |
From: Haritha J. <har...@ya...> - 2007-12-11 21:58:08
|
Yes i get this exception on calling JSONObject json =3D json.getJSONObject(= "JSON" );=0A=0AException in thread "main" net.sf.json.JSONException: JSONO= bject["JSON"] is not a JSONObject.=0A at net.sf.json.JSONObject.getJSONO= bject(JSONObject.java:1813)=0A at com.splashnote.web.pages.JavaToJson.ge= tJSON(JavaToJson.java:132)=0AHaritha=0A=0A----- Original Message ----=0AFro= m: Andres Almiray <aal...@ya...>=0ATo: Haritha Juturu <haritha.juturu= @yahoo.com>; jso...@li...=0ASent: Tuesday, December = 11, 2007 1:04:11 PM=0ASubject: Re: [json-lib-user] Quick Question on JSON= =0A=0A=0AHi Haritha,=0A=0AYou are right, if it is a nested JSONObject it sh= ould print it without the surrounding double quotes. As a last resort, can = you call=0A=0AJSONObject jsonObj =3D JSONObject.fromObject( textField, json= Config );=0AJSONObject json =3D json.getJSONObject( "JSON" );=0A=0AIf it re= ally is a JSONObject then no exception should arise. If no exception is thr= own then there may be something going on with the string representation of = a JSONObject when printed.=0A=0AThanks,=0AAndres=0A=0A=0A----- Original Mes= sage ----=0AFrom: Haritha Juturu <har...@ya...>=0ATo:=0A Andres= Almiray <aal...@ya...>; jso...@li...=0ASent: = Tuesday, December 11, 2007 12:59:32 PM=0ASubject: Re: [json-lib-user] Quick= Question on JSON=0A=0A=0AHi Andres=0A=0AThe TextField bean looks like this= =0Apublic class TextField(){ =0A private Long parentId;=0A private Lon= g textFieldId;=0A private String JSON;=0A}=0A=0AAfter executing the code= JSONObject jsonObj =3D JSONObject.fromObject( textField, jsonConfig ); , = i try to print this object 'jsonObj" and it prints the name value pair( of = JSON Property) with quotes=0A=0A{"parentId":678,"textFieldId":111,"JSON":"{= 'sizeWidth':620,'text':'=93[Winning the Nobel Peace Prize]=0A ','positionLe= ft':20,'style':'left:20px;top:100px;width:620px;height:100px;','positionTop= ':100,'name':'','cssClass':'','objectType':'TextObject','sizeHeight':100}"}= =0A=0AIf it was converting this 'JSON' property to JSONObject internally, w= ont it print as=0A=0A"JSON":=0A{"parentId":678,"textFieldId":111,"JSON":{'s= izeWidth':620,'text':'=93[Winning=0Athe Nobel Peace Prize]=0A','positionLef= t':20,'style':'left:20px;top:100px;width:620px;height:100px;','positionTop'= :100,'name':'','cssClass':'','objectType':'TextObject','sizeHeight':100}}= =0Awithout the quotes on the value.=0A=0APlease correct me if i got it wron= g=0A=0AI am using the json-lib-2.1 for jsd 1.5 version.=0AHaritha=0A=0A=0A= =0A----- Original Message ----=0AFrom: Andres Almiray <aal...@ya...>= =0ATo: Haritha Juturu <har...@ya...>; jso...@li...urc= eforge.net=0ASent: Tuesday, December 11, 2007 12:27:12 PM=0ASubject: Re: [j= son-lib-user] Quick Question on JSON=0A=0A=0AHi Haritha,=0A=0AAre you sure = the contents of the named property ('JSON') are not automatically converted= into a JSONObject ? it looks to me like it is a well formed json string, i= f so it should be converted automatically when you call fromObject() at top= level.=0A=0ACan you please tell us which version of Json-lib are you testi= ng with?=0A=0ARegards,=0AAndres=0A=0A----- Original Message ----=0AFrom: Ha= ritha Juturu <har...@ya...>=0ATo: jso...@li...urcefor= ge.net=0ASent: Tuesday, December 11, 2007 12:16:36 PM=0ASubject: [json-lib-= user] Quick Question on JSON=0A=0A=0AHi Everyone=0AI have a line of code=0A= JSONObject jsonObj =3D JSONObject.fromObject( textField, jsonConfig ); =0A= which produces this JSON string=0A=0A{"parentId":678,"textFieldId":111,=0A"= JSON":=0A"{'sizeWidth':620,'text':'=93[Winning the Nobel Peace Prize]','pos= itionLeft':20,'style':'left:20px;top:100px;width:620px;height:100px;','posi= tionTop':100,'name':'','cssClass':'','objectType':'TextObject','sizeHeight'= :100}"=0A}=0A=0Anow if i want the property "json" whose value is a string= =0A =93[Winning the Nobel Peace=0APrize]','positionLeft':20,'style':'left:2= 0px;top:100px;width:620px;height:100px;','positionTop':100,'name':'','cssCl= ass':'','objectType':'TextObject','sizeHeight':100}"=0A=0Ato be converted t= o a json object .... is there any API methods i can use.i am unable to loca= te any.=0A=0Ai.e my output should look like =0A{"parentId":678,"textFieldI= d":111,=0A"JSON": this value is not a string anymore=0A{'sizeWidth':620,'te= xt':'=93[Winning=0Athe Nobel Peace=0APrize]','positionLeft':20,'style':'lef= t:20px;top:100px;width:620px;height:100px;','positionTop':100,'name':'','cs= sClass':'','objectType':'TextObject','sizeHeight':100}=0A}=0A=0AI have a co= nstraint that i need to do this manipulation on the jsonObj .=0A=0AThanks= =0AHaritha=0A=0A=0A=0A=0A=0A=0A Be a better friend, newshound, and =0A= know-it-all with Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A=0A Be a be= tter friend, newshound, and =0Aknow-it-all with Yahoo! Mobile. Try it now.= =0A=0A=0A=0A=0A=0A Looking for last minute shopping deals? =0AFind th= em fast with Yahoo! Search.=0A=0A=0A=0A=0A=0A=0A=0A=0A Never miss a th= ing. Make Yahoo your homepage.=0A=0A=0A=0A=0A=0A=0A=0A _____________= _______________________________________________________________________=0AB= e a better friend, newshound, and =0Aknow-it-all with Yahoo! Mobile. Try i= t now. http://mobile.yahoo.com/;_ylt=3DAhu06i62sR8HDtDypao8Wcj9tAcJ =0A |
From: Andres A. <aal...@ya...> - 2007-12-13 05:19:00
|
Hi HAritha,=0A=0AOn closer inspection Json-lib is doing the correct thing b= y not converting the value of your property 'JSON' into a JSONObject, even = if it is a well-formed json string. In a previous version it did so, but th= at caused another bug with simpler json strings. So if you want to transfor= m that json string into a JSONObject you'll have to do it yourself. There a= re several options=0A=0A-- Option A=0AJSONObject jsonObj =3D JSONObject.fro= mObject( textField, jsonConfig );=0AjsonObj.set( "JSON", JSONObject.fromObj= ect( jsonObj.getJSONObject( "JSON" ), jsonConfig );=0A=0A-- Option B=0A=0A = JsonConfig jsonConfig =3D new JsonConfig();=0A jsonConfig.registe= rJsonValueProcessor( "JSON", new JsonValueProcessor(){=0A public Ob= ject processArrayValue( Object value, JsonConfig jsonConfig ) {=0A = // not interested in processing the value inside an array=0A = return value;=0A }=0A=0A public Object processObjectValue( = String key, Object value, JsonConfig jsonConfig ) {=0A return JS= ONObject.fromObject(value);=0A }=0A } );=0A JSONObject js= onObject =3D JSONObject.fromObject( textField, jsonConfig );=0A=0ACheers,= =0AAndres=0A=0A----- Original Message ----=0AFrom: Haritha Juturu <haritha.= ju...@ya...>=0ATo: Andres Almiray <aal...@ya...>; json-lib-user@= lists.sourceforge.net=0ASent: Tuesday, December 11, 2007 1:57:52 PM=0ASubje= ct: Re: [json-lib-user] Quick Question on JSON=0A=0A=0AYes i get this excep= tion on calling JSONObject json =3D json.getJSONObject( "JSON" );=0A=0AExce= ption in thread "main" net.sf.json.JSONException: JSONObject["JSON"] is not= a JSONObject.=0A at net.sf.json.JSONObject.getJSONObject(JSONObject.jav= a:1813)=0A at com.splashnote.web.pages.JavaToJson.getJSON(JavaToJson.jav= a:132)=0AHaritha=0A=0A----- Original Message ----=0AFrom: Andres Almiray <a= al...@ya...>=0ATo: Haritha Juturu <har...@ya...>; json-li= b-...@li...=0ASent: Tuesday, December 11, 2007 1:04:11 PM= =0ASubject: Re: [json-lib-user] Quick Question on=0A JSON=0A=0A=0AHi Harith= a,=0A=0AYou are right, if it is a nested JSONObject it should print it with= out the surrounding double quotes. As a last resort, can you call=0A=0AJSON= Object jsonObj =3D JSONObject.fromObject( textField, jsonConfig );=0AJSONOb= ject json =3D json.getJSONObject( "JSON" );=0A=0AIf it really is a JSONObje= ct then no exception should arise. If no exception is thrown then there may= be something going on with the string representation of a JSONObject when = printed.=0A=0AThanks,=0AAndres=0A=0A=0A----- Original Message ----=0AFrom: = Haritha Juturu <har...@ya...>=0ATo:=0A Andres Almiray <aalmiray= @yahoo.com>; jso...@li...=0ASent: Tuesday, December = 11, 2007 12:59:32 PM=0ASubject: Re: [json-lib-user] Quick Question on JSON= =0A=0A=0AHi Andres=0A=0AThe TextField bean looks like this=0Apublic class T= extField(){ =0A private Long parentId;=0A private Long textFieldId;=0A= private String JSON;=0A}=0A=0AAfter executing the code JSONObject jsonO= bj =3D JSONObject.fromObject( textField, jsonConfig ); , i try to print th= is object 'jsonObj" and it prints the name value pair( of JSON Property) wi= th quotes=0A=0A{"parentId":678,"textFieldId":111,"JSON":"{'sizeWidth':620,'= text':'=93[Winning the Nobel Peace Prize]=0A ','positionLeft':20,'style':'l= eft:20px;top:100px;width:620px;height:100px;','positionTop':100,'name':'','= cssClass':'','objectType':'TextObject','sizeHeight':100}"}=0A=0AIf it was c= onverting this 'JSON' property to JSONObject internally, wont it print as= =0A=0A"JSON":=0A{"parentId":678,"textFieldId":111,"JSON":{'sizeWidth':620,'= text':'=93[Winning=0Athe Nobel Peace Prize]=0A','positionLeft':20,'style':'= left:20px;top:100px;width:620px;height:100px;','positionTop':100,'name':'',= 'cssClass':'','objectType':'TextObject','sizeHeight':100}}=0Awithout the qu= otes on the value.=0A=0APlease correct me if i got it wrong=0A=0AI am using= the json-lib-2.1 for jsd 1.5 version.=0AHaritha=0A=0A=0A=0A----- Original = Message ----=0AFrom: Andres Almiray <aal...@ya...>=0ATo: Haritha Jutu= ru <har...@ya...>; jso...@li...=0ASent: = Tuesday, December 11, 2007 12:27:12 PM=0ASubject: Re: [json-lib-user] Quick= Question on JSON=0A=0A=0AHi Haritha,=0A=0AAre you sure the contents of the= named property ('JSON') are not automatically converted into a JSONObject = ? it looks to me like it is a well formed json string, if so it should be c= onverted automatically when you call fromObject() at top level.=0A=0ACan yo= u please tell us which version of Json-lib are you testing with?=0A=0ARegar= ds,=0AAndres=0A=0A----- Original Message ----=0AFrom: Haritha Juturu <harit= ha....@ya...>=0ATo: jso...@li...=0ASent: Tues= day, December 11, 2007 12:16:36 PM=0ASubject: [json-lib-user] Quick Questio= n on JSON=0A=0A=0AHi Everyone=0AI have a line of code=0AJSONObject jsonObj = =3D JSONObject.fromObject( textField, jsonConfig ); =0Awhich produces this= JSON string=0A=0A{"parentId":678,"textFieldId":111,=0A"JSON":=0A"{'sizeWid= th':620,'text':'=93[Winning the Nobel Peace Prize]','positionLeft':20,'styl= e':'left:20px;top:100px;width:620px;height:100px;','positionTop':100,'name'= :'','cssClass':'','objectType':'TextObject','sizeHeight':100}"=0A}=0A=0Anow= if i want the property "json" whose value is a string=0A =93[Winning the N= obel Peace=0APrize]','positionLeft':20,'style':'left:20px;top:100px;width:6= 20px;height:100px;','positionTop':100,'name':'','cssClass':'','objectType':= 'TextObject','sizeHeight':100}"=0A=0Ato be converted to a json object .... = is there any API methods i can use.i am unable to locate any.=0A=0Ai.e my o= utput should look like =0A{"parentId":678,"textFieldId":111,=0A"JSON": thi= s value is not a string anymore=0A{'sizeWidth':620,'text':'=93[Winning=0Ath= e Nobel Peace=0APrize]','positionLeft':20,'style':'left:20px;top:100px;widt= h:620px;height:100px;','positionTop':100,'name':'','cssClass':'','objectTyp= e':'TextObject','sizeHeight':100}=0A}=0A=0AI have a constraint that i need = to do this manipulation on the jsonObj .=0A=0AThanks=0AHaritha=0A=0A=0A=0A= =0A=0A=0A Be a better friend, newshound, and =0Aknow-it-all with Yahoo= ! Mobile. Try it now.=0A=0A=0A=0A=0A=0A Be a better friend, newshound= , and =0Aknow-it-all with Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A=0A = Looking for last minute shopping deals? =0AFind them fast with Yahoo! Se= arch.=0A=0A=0A=0A=0A=0A=0A=0A=0A Never miss a thing. Make Yahoo your= homepage.=0A=0A=0A=0A=0A=0A=0A=0A Be a better friend, newshound, and = =0Aknow-it-all with Yahoo! Mobile. Try it now.=0A=0A=0A=0A=0A=0A ____= ___________________________________________________________________________= _____=0ANever miss a thing. Make Yahoo your home page. =0Ahttp://www.yahoo= .com/r/hs |