Class JSONWithPadding<T>


  • public class JSONWithPadding<T>
    extends java.lang.Object

    JSONWithPadding is used to hold an Object along with the corresponding callback name to marshal.

    Sample Usage: JSONWithPadding<Person> jsonWithPaddingObject = new JSONWithPadding(person, "theCallBackName"); Marshal this jsonWithPaddingObject object would result in JSON like this: theCallBackName({"person":{"id":10,"name":"Bob"}});

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCallbackName()
      The callback name that should me marshalled with the object
      T getObject()
      The Object that will be marshalled
      void setCallbackName​(java.lang.String callbackName)
      The callback name that should me marshalled with the object
      void setObject​(T rootObject)
      The Object to be marshalled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_CALLBACK_NAME

        public static final java.lang.String DEFAULT_CALLBACK_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • JSONWithPadding

        public JSONWithPadding()
      • JSONWithPadding

        public JSONWithPadding​(T rootObject)
      • JSONWithPadding

        public JSONWithPadding​(T rootObject,
                               java.lang.String callbackName)
    • Method Detail

      • getObject

        public T getObject()
        The Object that will be marshalled
        Returns:
      • setObject

        public void setObject​(T rootObject)
        The Object to be marshalled
        Parameters:
        rootObject -
      • getCallbackName

        public java.lang.String getCallbackName()
        The callback name that should me marshalled with the object
        Returns:
      • setCallbackName

        public void setCallbackName​(java.lang.String callbackName)
        The callback name that should me marshalled with the object