All Known Implementing Classes:
AbstractBodyDecoderHandler, AbstractDeserializationHandler, AbstractReentrantDeserializationHandler, ArrayHandler, ArrayListHandler, AssociatedDataHandler, BitSetHandler, BooleanHandler, ByteArrayHandler, ClassHandler, ColorHandler, ColorStateHandler, ComponentDeserializationHandler, CursorHandler, DateHandler, DimensionHandler, DocumentElementHandler, Ellipse2DDoubleHandler, Ellipse2DFloatHandler, EnumHandler, EnumSetHandler, FontHandler, GeneralPathHandler, IgPathHandler, InsetsHandler, LayoutConstraintsHandler, MethodHandler, NullHandler, NumberHandler, ObjectDeserializationHandler, Point2DDoubleHandler, Point2DFloatHandler, PointHandler, PrimitiveArrayHandler, QualifiedPathHandler, QualityCodeHandler, Rectangle2DDoubleHandler, Rectangle2DFloatHandler, RectangleHandler, RoundRectangle2DDoubleHandler, RoundRectangle2DFloatHandler, ShapeDeserializationHandler, StringHandler, TagPathHandler, TagQualityHandler, UUIDHandler

public interface DeserializationHandler
A deserialization handler handles a section of an XML parsing for a specific element. Each element that is not another element's namespace child needs to produce an Object.
  • Method Details

    • startElement

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

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

      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(String name, AttributesMap attributes, DeserializationContext context) throws Exception
      Notifies the handler that a sub-element has started.
      Throws:
      Exception
    • endSubElement

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

      void onBody(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(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

      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

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