Class ObjectHelper

    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectHelper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class getHelpedClass()  
      java.lang.Object parseValue​(JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool)
      Convert JSON representation into an instance of a class.
      void renderValue​(java.lang.Object aObj, JSONObject aObjectElement, JSONMarshall aMarshall, java.util.HashMap aPool)
      Convert an element to JSON.
      • Methods inherited from class java.lang.Object

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

      • ObjectHelper

        public ObjectHelper()
    • Method Detail

      • renderValue

        public void renderValue​(java.lang.Object aObj,
                                JSONObject aObjectElement,
                                JSONMarshall aMarshall,
                                java.util.HashMap aPool)
                         throws MarshallException
        Description copied from interface: MarshallHelper
        Convert an element to JSON.
        Specified by:
        renderValue in interface MarshallHelper
        Parameters:
        aObj - Instance that should be rendered to JSON.
        aObjectElement - The parent element where we have to put the rendered information. A helper is allowed to add child elements.
        aMarshall - The marshall we can use to recursively render parts of our own object.
        aPool - A pool of objects already encountered. Is used to resolve references.
        Throws:
        MarshallException
      • parseValue

        public java.lang.Object parseValue​(JSONObject aObjectElement,
                                           JSONMarshall aMarshall,
                                           java.util.HashMap aPool)
                                    throws MarshallException
        Description copied from interface: MarshallHelper
        Convert JSON representation into an instance of a class.
        Specified by:
        parseValue in interface MarshallHelper
        Parameters:
        aObjectElement - The source element we have to convert into an object.
        aMarshall - The marshall we can use to convert sub elements into subobjects to compose our target object.
        aPool - A pool of objects already encountered. Is used to resolve references.
        Returns:
        The newly created object.
        Throws:
        MarshallException
      • getHelpedClass

        public java.lang.Class getHelpedClass()
        Specified by:
        getHelpedClass in interface Helper