• Filip
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies

Hello guys,

 

I am trying to call this method

 

  public JSONObject getJSONObject(String key)  {     Object o = get(key);        if (o instanceof JSONObject) {            return (JSONObject)o;        }        throw new JSONException('JSONObject[' + quote(key) +                '] is not a JSONObject.'); 

}

..declared under public class JSONObject. I am calling it with this code:

 

protected virtual List<SearchResult> parseSearchResults(String json) {

JSONObject j = new JSONObject(json);

JSONObject a = new j.getJSONObject('results');  

 

 

 

  

 

 

 

 

 

 

...but keep getting compile error 

 

Error: Compile Error: Invalid type: j.getJSONObject at line 221 column 28  

 

 

 

 

 Can you please help? I have tried all permutations I could imagine.

 

Many thanks

F. 

   

Message Edited by Filip on 02-03-2009 10:56 AM
Message Edited by Filip on 02-03-2009 10:57 AM
  • February 03, 2009
  • Like
  • 0

Dear colleagues,

 

I am struggling with the debug log detail while using opensource JSONObject code. I am processing a fairly short JSON string, but the log overfills and I cannot see my own messages appearing later on.

 

Here is a screenshot:

  

20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms20090203160403.602:Class.JSONObject.JSONTokener.nextString: line 1181, column 17: returning String from method public String next() in 1 ms20090203160403.602:Class.JSONObject.JSONTokener.next: line 1043, column 17: returning String from method String read(String) in 0 ms*********** MAXIMUM DEBUG LOG SIZE REACHED **************

 

 

I checked the places in the code (lines 1043 and 1181), but there is no explicit system.debug that I can suppress.

Is there any way how to filter this out?

 

Many thanks

 

Filip 

 

  

  • February 03, 2009
  • Like
  • 0

Hello guys,

 

What is this Visualforce component, please? The reference library is really missing picture examples...

 

 

 

It's on most standard pages.

Also, is there a way to see the VF code of standard pages? 

 

 

Many thanks

Filip 

  • February 02, 2009
  • Like
  • 0

Hello guys,

 

I am trying to call this method

 

  public JSONObject getJSONObject(String key)  {     Object o = get(key);        if (o instanceof JSONObject) {            return (JSONObject)o;        }        throw new JSONException('JSONObject[' + quote(key) +                '] is not a JSONObject.'); 

}

..declared under public class JSONObject. I am calling it with this code:

 

protected virtual List<SearchResult> parseSearchResults(String json) {

JSONObject j = new JSONObject(json);

JSONObject a = new j.getJSONObject('results');  

 

 

 

  

 

 

 

 

 

 

...but keep getting compile error 

 

Error: Compile Error: Invalid type: j.getJSONObject at line 221 column 28  

 

 

 

 

 Can you please help? I have tried all permutations I could imagine.

 

Many thanks

F. 

   

Message Edited by Filip on 02-03-2009 10:56 AM
Message Edited by Filip on 02-03-2009 10:57 AM
  • February 03, 2009
  • Like
  • 0

Hello guys,

 

What is this Visualforce component, please? The reference library is really missing picture examples...

 

 

 

It's on most standard pages.

Also, is there a way to see the VF code of standard pages? 

 

 

Many thanks

Filip 

  • February 02, 2009
  • Like
  • 0