org.directwebremoting.json.parse.impl
Class IgnoreJsonDecoder

java.lang.Object
  extended by org.directwebremoting.json.parse.impl.IgnoreJsonDecoder
All Implemented Interfaces:
JsonDecoder

public class IgnoreJsonDecoder
extends java.lang.Object
implements JsonDecoder

A JsonDecoder that doesn't do anything, which is useful for validations that don't need to get any data, just check it's validity.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
IgnoreJsonDecoder()
           
 
Method Summary
 void addBoolean(java.lang.String propertyName, boolean value)
          Add a boolean member.
 void addNull(java.lang.String propertyName)
          Add a null member.
 void addNumber(java.lang.String propertyName, java.lang.String intPart, java.lang.String floatPart, java.lang.String expPart)
          Add a numeric member.
 void addString(java.lang.String propertyName, java.lang.String value)
          Add a string member.
 void beginArray(java.lang.String propertyName)
          We have encountered a [.
 void beginObject(java.lang.String propertyName)
          We have encountered a {.
 void endArray(java.lang.String propertyName)
          We have encountered a ].
 void endObject(java.lang.String propertyName)
          We have encountered a }.
 java.lang.Object getRoot()
          When the parse is finished, this gives access to the result
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnoreJsonDecoder

public IgnoreJsonDecoder()
Method Detail

getRoot

public java.lang.Object getRoot()
Description copied from interface: JsonDecoder
When the parse is finished, this gives access to the result

Specified by:
getRoot in interface JsonDecoder

addBoolean

public void addBoolean(java.lang.String propertyName,
                       boolean value)
                throws JsonParseException
Description copied from interface: JsonDecoder
Add a boolean member. See the note on JsonDecoder.addString(String, String) for the meaning of the propertyName argument.

Specified by:
addBoolean in interface JsonDecoder
Throws:
JsonParseException

addNull

public void addNull(java.lang.String propertyName)
             throws JsonParseException
Description copied from interface: JsonDecoder
Add a null member. See the note on JsonDecoder.addString(String, String) for the meaning of the propertyName argument.

Specified by:
addNull in interface JsonDecoder
Throws:
JsonParseException

addNumber

public void addNumber(java.lang.String propertyName,
                      java.lang.String intPart,
                      java.lang.String floatPart,
                      java.lang.String expPart)
               throws JsonParseException
Description copied from interface: JsonDecoder
Add a numeric member. See the note on JsonDecoder.addString(String, String) for the meaning of the propertyName argument. The 3 parts are put together like this: {intPart}[.{floatPart}][E{expPart}]. For example:

Specified by:
addNumber in interface JsonDecoder
Throws:
JsonParseException

addString

public void addString(java.lang.String propertyName,
                      java.lang.String value)
               throws JsonParseException
Description copied from interface: JsonDecoder
Add a string member. If the member is added to an object then the propertyName argument will be the part of the JSON string before the ':'. If the member is added to an array, then propertyName will be null. See the note on JsonDecoder.beginObject(String)

Specified by:
addString in interface JsonDecoder
Throws:
JsonParseException

beginArray

public void beginArray(java.lang.String propertyName)
                throws JsonParseException
Description copied from interface: JsonDecoder
We have encountered a [. If this object is a top level object, or the object is being added to an array, then the propertyName argument will be null, otherwise it will contain the name that this object will be assigned to in the parent object. What follows is a series of addXxxxx() calls, possibly including nested arrays and objects, followed by a call to JsonDecoder.endArray(String).

Specified by:
beginArray in interface JsonDecoder
Throws:
JsonParseException

beginObject

public void beginObject(java.lang.String propertyName)
                 throws JsonParseException
Description copied from interface: JsonDecoder
We have encountered a {. If this object is a top level object, or the object is being added to an array, then the propertyName argument will be null, otherwise it will contain the name that this object will be assigned to in the parent object. What follows is a series of addXxxx() calls, possibly nested arrays and objects, followed by a call to JsonDecoder.endObject(String)

Specified by:
beginObject in interface JsonDecoder
Throws:
JsonParseException

endArray

public void endArray(java.lang.String propertyName)
              throws JsonParseException
Description copied from interface: JsonDecoder
We have encountered a ]. This is called in a matching pair to JsonDecoder.beginArray(String) The propertyName argument will match the value given in the corresponding JsonDecoder.beginArray(String) call.

Specified by:
endArray in interface JsonDecoder
Throws:
JsonParseException
See Also:
JsonDecoder.beginArray(String)

endObject

public void endObject(java.lang.String propertyName)
               throws JsonParseException
Description copied from interface: JsonDecoder
We have encountered a }. This is called in a matching pair to JsonDecoder.beginObject(String) The propertyName argument will match the value given in the corresponding JsonDecoder.beginObject(String) call.

Specified by:
endObject in interface JsonDecoder
Throws:
JsonParseException

Copyright 2008