|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JsonDecoder
Used by JsonParser to allow the parse process to be mostly stateless,
and to abstract the process of creating objects. It is very likely that
StatefulJsonDecoder will be
an easier start point than this.
| 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 |
| Method Detail |
|---|
java.lang.Object getRoot()
throws JsonParseException
JsonParseException
void beginObject(java.lang.String propertyName)
throws JsonParseException
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 endObject(String)
JsonParseException
void endObject(java.lang.String propertyName)
throws JsonParseException
beginObject(String)
The propertyName argument will match the value given in the
corresponding beginObject(String) call.
JsonParseException
void beginArray(java.lang.String propertyName)
throws JsonParseException
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 endArray(String).
JsonParseException
void endArray(java.lang.String propertyName)
throws JsonParseException
beginArray(String)
The propertyName argument will match the value given in the
corresponding beginArray(String) call.
JsonParseExceptionbeginArray(String)
void addString(java.lang.String propertyName,
java.lang.String value)
throws JsonParseException
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 beginObject(String)
JsonParseException
void addNumber(java.lang.String propertyName,
java.lang.String intPart,
java.lang.String floatPart,
java.lang.String expPart)
throws JsonParseException
addString(String, String) for the meaning of the
propertyName argument.
The 3 parts are put together like this:
{intPart}[.{floatPart}][E{expPart}]. For example:
JsonParseException
void addBoolean(java.lang.String propertyName,
boolean value)
throws JsonParseException
addString(String, String) for the meaning of the
propertyName argument.
JsonParseException
void addNull(java.lang.String propertyName)
throws JsonParseException
addString(String, String) for the meaning of the
propertyName argument.
JsonParseException
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||