public class Marshaller extends java.lang.Object implements MarshallerInterface
JSONContext
Modifier | Constructor and Description |
---|---|
protected |
Marshaller(JSONContext context) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
marshal(java.lang.Object object)
marshaller converte recursivelly a java object and return a js object in the form of a string.
|
protected Marshaller(JSONContext context)
public java.lang.String marshal(java.lang.Object object) throws ParserException, java.lang.InstantiationException, java.lang.IllegalAccessException
First, the call will try to use a converter. If none found, it will assume the object is a bean, therefore create a js object.
To create the parameters list, it will try to match a field with a getter. You can discard some with the anotation @DISCARD
note the call is recursive
warning : the method doesn't yet have a safe loop mecanism. trying to parse such object will end in a seg fault
since 1.4 also discard any static or volatile method
marshal
in interface MarshallerInterface
object
- object to marshalParserException
java.lang.InstantiationException
java.lang.IllegalAccessException
Discard