Interface DeserializationHandler
-
- All Known Implementing Classes:
AbstractBodyDecoderHandler
,AbstractDeserializationHandler
,AbstractReentrantDeserializationHandler
,ArrayHandler
,ArrayListHandler
,BitSetHandler
,BooleanHandler
,ByteArrayHandler
,ClassHandler
,ColorHandler
,ColorStateHandler
,ComponentDeserializationHandler
,CursorHandler
,DateHandler
,DimensionHandler
,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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DeserializationHandler
clone()
Clones this handler.void
endElement(DeserializationContext context)
Notifies the handler that their element has ended.void
endObject(java.lang.Object obj)
Notifies the handler that an object tag was found and deserialized within their scopevoid
endSubElement(java.lang.String name, DeserializationContext context)
Notifies the handler that a sub-element has endedDecoder<?>
getBodyDecoder()
Called when body data is encountered in this tag or a sub-tag.java.lang.String
getElementName()
Returns the name of the element type that this handler ...java.lang.Object
getObject()
Returns the most recent object that this handler created.int
getRefId()
Returns the reference id that was in the start of this element, or -1 if there was nonevoid
onBody(java.lang.Object body)
Called when body data is encountered in this tag or a sub-tag.void
setRefId(int id)
Sets the ref-id that was found at the start of this element, if any.void
startElement(java.lang.String name, AttributesMap attributes, DeserializationContext context)
Notifies the handler that their element has started.void
startSubElement(java.lang.String name, AttributesMap attributes, DeserializationContext context)
Notifies the handler that a sub-element has started.boolean
supportsNestedElements()
Return true if the element type that you're parsing can have nested elements, or false if you're a singleton element.
-
-
-
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 (seegetBodyDecoder()
), 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 toonBody(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.
-
-