|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.addsimplicity.anicetus.io.JsonEncoder
public class JsonEncoder
The encoder translates telemetry into a JSON string. The object graph is fully exported. In addition to serializing telemetry artifacts, the application can also set classes that are to be treated like beans when serializing. If an object is not a telemetry object and is not a bean, then its toString method is used to generate the value.
| Constructor Summary | |
|---|---|
JsonEncoder()
|
|
| Method Summary | |
|---|---|
void |
addBeanType(java.lang.Class<? extends java.lang.Object> bean)
Add a class to be treated as a bean during encoding. |
static void |
addDefaultBeanType(java.lang.Class<? extends java.lang.Object> beanType)
Add a default bean type. |
char[] |
encode(GlobalInfo session)
Encode the telemetry graph as JSON. |
java.util.Set<java.lang.Class<? extends java.lang.Object>> |
getBeanTypes()
Return the current list of bean types in use by the encoder. |
ExceptionHandler |
getExceptionHandler()
Return the exception handler currently in effect. |
void |
setBeanTypes(java.util.Set<java.lang.Class<? extends java.lang.Object>> beanTypes)
Set the bean types that will be used during JSON encoding. |
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Set the exception handler that will receive exceptions encountered during encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonEncoder()
| Method Detail |
|---|
public static void addDefaultBeanType(java.lang.Class<? extends java.lang.Object> beanType)
beanType - The class of the bean type to add.public void addBeanType(java.lang.Class<? extends java.lang.Object> bean)
bean - The class of the bean object.public char[] encode(GlobalInfo session)
encode in interface TelemetryEncodersession - The telemetry graph to encode.
public java.util.Set<java.lang.Class<? extends java.lang.Object>> getBeanTypes()
public ExceptionHandler getExceptionHandler()
public void setBeanTypes(java.util.Set<java.lang.Class<? extends java.lang.Object>> beanTypes)
beanTypes - The set of bean types to be added to the list.public void setExceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler - The exception handler.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||