Interface DeserializationHandler

    • Method Detail

      • startElement

        void startElement​(java.lang.String name,
                          AttributesMap attributes,
                          DeserializationContext context)
                   throws java.lang.Exception
        Notifies the handler that their element has started.
        Throws:
        java.lang.Exception
      • endElement

        void endElement​(DeserializationContext context)
                 throws java.lang.Exception
        Notifies the handler that their element has ended.
        Throws:
        java.lang.Exception
      • getObject

        java.lang.Object getObject()
        Returns the most recent object that this handler created. Note that a handler needs to have this function return its object as early as possible, not just after endElement() has been called. This is used for populating the reference map.
      • startSubElement

        void startSubElement​(java.lang.String name,
                             AttributesMap attributes,
                             DeserializationContext context)
                      throws java.lang.Exception
        Notifies the handler that a sub-element has started.
        Throws:
        java.lang.Exception
      • endSubElement

        void endSubElement​(java.lang.String name,
                           DeserializationContext context)
                    throws java.lang.Exception
        Notifies the handler that a sub-element has ended
        Throws:
        java.lang.Exception
      • onBody

        void onBody​(java.lang.Object body)
        Called when body data is encountered in this tag or a sub-tag. This data is first interpreted by the handler-provided decoder (see getBodyDecoder()), and then this function will be called.
      • getBodyDecoder

        Decoder<?> getBodyDecoder()
        Called when body data is encountered in this tag or a sub-tag. Used to decode the body into an object, which is then passed to onBody(Object)
      • endObject

        void endObject​(java.lang.Object obj)
        Notifies the handler that an object tag was found and deserialized within their scope
      • getRefId

        int getRefId()
        Returns the reference id that was in the start of this element, or -1 if there was none
      • setRefId

        void setRefId​(int id)
        Sets the ref-id that was found at the start of this element, if any.
      • getElementName

        java.lang.String getElementName()
        Returns the name of the element type that this handler ... handles.
      • supportsNestedElements

        boolean supportsNestedElements()

        Return true if the element type that you're parsing can have nested elements, or false if you're a singleton element. If you return true, you need to implement clone().

        Note As of Ignition 7.6.5 with support for multi-deserialization, you should also return true from this and implement clone() if your return object is mutable, otherwise instances may be shared amongst multi-deserialized objects.

      • clone

        DeserializationHandler clone()
        Clones this handler. Only handlers that support nested elements will be cloned, all others can throw an unsupported operation exception instead.