Class NullHandler
- java.lang.Object
-
- com.inductiveautomation.ignition.common.xmlserialization.deserialization.handlers.NullHandler
-
- All Implemented Interfaces:
DeserializationHandler
public class NullHandler extends java.lang.Object implements DeserializationHandler
-
-
Constructor Summary
Constructors Constructor Description NullHandler()
-
Method Summary
All Methods Instance Methods Concrete 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
-
onBody
public void onBody(java.lang.Object body)
Description copied from interface:DeserializationHandler
Called when body data is encountered in this tag or a sub-tag. This data is first interpreted by the handler-provided decoder (seeDeserializationHandler.getBodyDecoder()
), and then this function will be called.- Specified by:
onBody
in interfaceDeserializationHandler
-
getBodyDecoder
public Decoder<?> getBodyDecoder()
Description copied from interface:DeserializationHandler
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 toDeserializationHandler.onBody(Object)
- Specified by:
getBodyDecoder
in interfaceDeserializationHandler
-
endElement
public void endElement(DeserializationContext context) throws java.lang.Exception
Description copied from interface:DeserializationHandler
Notifies the handler that their element has ended.- Specified by:
endElement
in interfaceDeserializationHandler
- Throws:
java.lang.Exception
-
endObject
public void endObject(java.lang.Object obj)
Description copied from interface:DeserializationHandler
Notifies the handler that an object tag was found and deserialized within their scope- Specified by:
endObject
in interfaceDeserializationHandler
-
endSubElement
public void endSubElement(java.lang.String name, DeserializationContext context) throws java.lang.Exception
Description copied from interface:DeserializationHandler
Notifies the handler that a sub-element has ended- Specified by:
endSubElement
in interfaceDeserializationHandler
- Throws:
java.lang.Exception
-
getElementName
public java.lang.String getElementName()
Description copied from interface:DeserializationHandler
Returns the name of the element type that this handler ... handles.- Specified by:
getElementName
in interfaceDeserializationHandler
-
startElement
public void startElement(java.lang.String name, AttributesMap attributes, DeserializationContext context) throws java.lang.Exception
Description copied from interface:DeserializationHandler
Notifies the handler that their element has started.- Specified by:
startElement
in interfaceDeserializationHandler
- Throws:
java.lang.Exception
-
startSubElement
public void startSubElement(java.lang.String name, AttributesMap attributes, DeserializationContext context) throws java.lang.Exception
Description copied from interface:DeserializationHandler
Notifies the handler that a sub-element has started.- Specified by:
startSubElement
in interfaceDeserializationHandler
- Throws:
java.lang.Exception
-
getObject
public java.lang.Object getObject()
Description copied from interface:DeserializationHandler
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.- Specified by:
getObject
in interfaceDeserializationHandler
-
supportsNestedElements
public boolean supportsNestedElements()
Description copied from interface:DeserializationHandler
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.
- Specified by:
supportsNestedElements
in interfaceDeserializationHandler
-
clone
public DeserializationHandler clone()
Description copied from interface:DeserializationHandler
Clones this handler. Only handlers that support nested elements will be cloned, all others can throw an unsupported operation exception instead.- Specified by:
clone
in interfaceDeserializationHandler
- Overrides:
clone
in classjava.lang.Object
-
getRefId
public int getRefId()
Description copied from interface:DeserializationHandler
Returns the reference id that was in the start of this element, or -1 if there was none- Specified by:
getRefId
in interfaceDeserializationHandler
-
setRefId
public void setRefId(int id)
Description copied from interface:DeserializationHandler
Sets the ref-id that was found at the start of this element, if any.- Specified by:
setRefId
in interfaceDeserializationHandler
-
-