org.loom.json
Class JsonMarshaller

java.lang.Object
  extended by org.loom.json.JsonMarshaller

Deprecated. use jackson ObjectMapper instead

public class JsonMarshaller
extends java.lang.Object

Generates a JSON representation of the underlying HashMap, in the most readable form possible. That means, if the object has a single property, uses an assignment. Else, use object extension (Object.extend(...)) or JSON object declaration.


Constructor Summary
JsonMarshaller()
          Deprecated.  
JsonMarshaller(java.lang.String name)
          Deprecated.  
JsonMarshaller(java.lang.String name, java.util.Map<java.lang.String,?> contents)
          Deprecated.  
 
Method Summary
 JsonMarshaller add(java.lang.String name, java.lang.Object value)
          Deprecated. Add one attribute to this JSON object
 JsonMarshaller addAll(java.util.Map<java.lang.String,?> entries)
          Deprecated. Add all entries in a Map
 JsonMarshaller addExpression(java.lang.String name, java.lang.String expression)
          Deprecated. Append an expression such as max: MyClass.calculate()
static void appendPropertyValue(java.lang.StringBuilder builder, java.lang.Object object)
          Deprecated. Serialize a property value and appends it to the StringBuilder passed as argument
 void buildBody(java.lang.StringBuilder builder)
          Deprecated.  
 java.lang.Object get(java.lang.String propertyName)
          Deprecated.  
 java.lang.String getId()
          Deprecated.  
 boolean isEmpty()
          Deprecated.  
 boolean isQuotePropertyNames()
          Deprecated.  
 void setDeclare(boolean declare)
          Deprecated.  
 void setId(java.lang.String name)
          Deprecated.  
 void setQuotePropertyNames(boolean quoteAllPropertyNames)
          Deprecated.  
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonMarshaller

public JsonMarshaller()
Deprecated. 

JsonMarshaller

public JsonMarshaller(java.lang.String name)
Deprecated. 

JsonMarshaller

public JsonMarshaller(java.lang.String name,
                      java.util.Map<java.lang.String,?> contents)
Deprecated. 
Method Detail

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object
Returns:
the JSON representation of this object

buildBody

public void buildBody(java.lang.StringBuilder builder)
Deprecated. 
Parameters:
builder -

appendPropertyValue

public static void appendPropertyValue(java.lang.StringBuilder builder,
                                       java.lang.Object object)
Deprecated. 
Serialize a property value and appends it to the StringBuilder passed as argument


setId

public void setId(java.lang.String name)
Deprecated. 

isEmpty

public boolean isEmpty()
Deprecated. 
Returns:
true if there is any property in this Json object

getId

public java.lang.String getId()
Deprecated. 

get

public java.lang.Object get(java.lang.String propertyName)
Deprecated. 

addAll

public JsonMarshaller addAll(java.util.Map<java.lang.String,?> entries)
Deprecated. 
Add all entries in a Map


add

public JsonMarshaller add(java.lang.String name,
                          java.lang.Object value)
Deprecated. 
Add one attribute to this JSON object

Parameters:
name - name of the attribute
value - value

addExpression

public JsonMarshaller addExpression(java.lang.String name,
                                    java.lang.String expression)
Deprecated. 
Append an expression such as max: MyClass.calculate()


setDeclare

public void setDeclare(boolean declare)
Deprecated. 

isQuotePropertyNames

public boolean isQuotePropertyNames()
Deprecated. 

setQuotePropertyNames

public void setQuotePropertyNames(boolean quoteAllPropertyNames)
Deprecated.