com.twistedmatrix.spread
Class Jelly.JellyEncoder

java.lang.Object
  |
  +--com.twistedmatrix.spread.Jelly.JellyEncoder
Direct Known Subclasses:
PBJellyEncoder
Enclosing class:
Jelly

public static class Jelly.JellyEncoder
extends java.lang.Object

Encodes an object using Jelly s-expression format. Supports null, Integer, ByteString, Byte, Short, Float, Double, byte[] and List, Map and Object[] of supported types. The actual result is either a List, Double, Integer, or ByteString.


Constructor Summary
Jelly.JellyEncoder()
           
 
Method Summary
protected  java.lang.Object _jelly(Jellyable instance)
           
protected  java.lang.Object _jelly(java.util.Map dict)
           
protected  java.lang.Object _jellyOther(java.lang.Object o)
          Override in subclasses to handle additional object types.
 java.lang.Object jelly(java.lang.Object o)
          Make a Jelly S-Expression from an object.
protected  java.util.ArrayList prepare(java.lang.Object o)
           
protected  java.util.ArrayList preserve(java.lang.Object o, java.util.ArrayList sexp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jelly.JellyEncoder

public Jelly.JellyEncoder()
Method Detail

prepare

protected java.util.ArrayList prepare(java.lang.Object o)

preserve

protected java.util.ArrayList preserve(java.lang.Object o,
                                       java.util.ArrayList sexp)

jelly

public java.lang.Object jelly(java.lang.Object o)
Make a Jelly S-Expression from an object.

_jelly

protected java.lang.Object _jelly(Jellyable instance)

_jelly

protected java.lang.Object _jelly(java.util.Map dict)

_jellyOther

protected java.lang.Object _jellyOther(java.lang.Object o)
Override in subclasses to handle additional object types.
Returns:
null if the object is an instance of an unhandled class.