|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.addsimplicity.anicetus.io.JsonDecoder
public class JsonDecoder
The decoder translates a JSON encoded telemetry into a Java object. In addition to decoding the telemetry maps, the decoder will also attempt to decode simple Java beans. It relies upon the application adding packages for searching for types to detect a bean. If it encounters a type it doesn't recognize, it decodes it into a TelemetryState which is just a simple map.
| Constructor Summary | |
|---|---|
JsonDecoder()
|
|
| Method Summary | |
|---|---|
static void |
addDefaultPackage(java.lang.String pkgName)
Add a default package to the search list that will be used for decoding JSON. |
GlobalInfo |
decode(char[] jsonEncoded)
Convert a character array that represents a JSON encoded object. |
ExceptionHandler |
getExceptionHandler()
Return the exception handler in effect for the decoder. |
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Set the exception handler that will receive any exception that occurs during decoding. |
void |
setSearchPackages(java.lang.String[] packages)
Add packages to the package search list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonDecoder()
| Method Detail |
|---|
public static void addDefaultPackage(java.lang.String pkgName)
pkgName - The name of the package to add.public GlobalInfo decode(char[] jsonEncoded)
decode in interface TelemetryDecoderjsonEncoded - The encoded JSON object as a character array.
public ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler - The exception handler.public void setSearchPackages(java.lang.String[] packages)
packages - The list of packages to add.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||