org.codehaus.groovy.grails.web.json
Class PathCapturingJSONWriterWrapper

java.lang.Object
  extended by org.codehaus.groovy.grails.web.json.JSONWriter
      extended by org.codehaus.groovy.grails.web.json.PathCapturingJSONWriterWrapper

public class PathCapturingJSONWriterWrapper
extends JSONWriter

TODO Proof of concept Should capture the JSON Path to the current element

Author:
Siegfried Puchbauer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.groovy.grails.web.json.JSONWriter
JSONWriter.Mode
 
Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.web.json.JSONWriter
comma, mode, writer
 
Constructor Summary
PathCapturingJSONWriterWrapper(Writer w, JSONWriter delegate)
           
 
Method Summary
 JSONWriter append(String s)
          Append a value.
 JSONWriter array()
          Begin appending a new array.
 void comma()
           
 JSONWriter end(JSONWriter.Mode m, char c)
          End something.
 JSONWriter endArray()
          End an array.
 JSONWriter endObject()
          End an object.
 JSONWriter key(String s)
          Append a key.
 JSONWriter object()
          Begin appending a new object.
 void pop(JSONWriter.Mode c)
          Pop an array or object scope.
 void push(JSONWriter.Mode c)
          Push an array or object scope.
 JSONWriter value(boolean b)
          Append either the value true or the value false.
 JSONWriter value(double d)
          Append a double value.
 JSONWriter value(long l)
          Append a long value.
 JSONWriter value(Object o)
          Append an object value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathCapturingJSONWriterWrapper

public PathCapturingJSONWriterWrapper(Writer w,
                                      JSONWriter delegate)
Method Detail

append

public JSONWriter append(String s)
Description copied from class: JSONWriter
Append a value.

Overrides:
append in class JSONWriter
Parameters:
s - A string value.
Returns:
this

comma

public void comma()
Overrides:
comma in class JSONWriter

array

public JSONWriter array()
Description copied from class: JSONWriter
Begin appending a new array. All values until the balancing endArray will be appended to this array. The endArray method must be called to mark the array's end.

Overrides:
array in class JSONWriter
Returns:
this

end

public JSONWriter end(JSONWriter.Mode m,
                      char c)
Description copied from class: JSONWriter
End something.

Overrides:
end in class JSONWriter
Parameters:
m - Mode
c - Closing character
Returns:
this

endArray

public JSONWriter endArray()
Description copied from class: JSONWriter
End an array. This method most be called to balance calls to array.

Overrides:
endArray in class JSONWriter
Returns:
this

endObject

public JSONWriter endObject()
Description copied from class: JSONWriter
End an object. This method most be called to balance calls to object.

Overrides:
endObject in class JSONWriter
Returns:
this

key

public JSONWriter key(String s)
Description copied from class: JSONWriter
Append a key. The key will be associated with the next value. In an object, every value must be preceded by a key.

Overrides:
key in class JSONWriter
Parameters:
s - A key string.
Returns:
this

object

public JSONWriter object()
Description copied from class: JSONWriter
Begin appending a new object. All keys and values until the balancing endObject will be appended to this object. The endObject method must be called to mark the object's end.

Overrides:
object in class JSONWriter
Returns:
this

pop

public void pop(JSONWriter.Mode c)
Description copied from class: JSONWriter
Pop an array or object scope.

Overrides:
pop in class JSONWriter
Parameters:
c - The scope to close.

push

public void push(JSONWriter.Mode c)
Description copied from class: JSONWriter
Push an array or object scope.

Overrides:
push in class JSONWriter
Parameters:
c - The scope to open.

value

public JSONWriter value(boolean b)
Description copied from class: JSONWriter
Append either the value true or the value false.

Overrides:
value in class JSONWriter
Parameters:
b - A boolean.
Returns:
this

value

public JSONWriter value(double d)
Description copied from class: JSONWriter
Append a double value.

Overrides:
value in class JSONWriter
Parameters:
d - A double.
Returns:
this

value

public JSONWriter value(long l)
Description copied from class: JSONWriter
Append a long value.

Overrides:
value in class JSONWriter
Parameters:
l - A long.
Returns:
this

value

public JSONWriter value(Object o)
Description copied from class: JSONWriter
Append an object value.

Overrides:
value in class JSONWriter
Parameters:
o - The object to append. It can be null, or a Boolean, Number, String, JSONObject, or JSONArray.
Returns:
this


Copyright (c) 2005-2009 The Grails project