Search this API

y.io.graphml.input
Class DeserializationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by y.io.graphml.input.DeserializationEvent
All Implemented Interfaces:
java.io.Serializable

public final class DeserializationEvent
extends java.util.EventObject

The event arguments used by DeserializationHandler implementations to let registered deserialization code perform the deserialization.

If the event handler determines that it can deserialize the getXmlNode(), it should place the result into the getResult() property and thus mark the event as isHandled().

See Also:
Serialized Form
 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DeserializationEvent(java.lang.Object source, GraphMLParseContext context, org.w3c.dom.Node xmlNode)
          Initializes a new instance of the DeserializationEvent class.
DeserializationEvent(java.lang.Object source, GraphMLParseContext context, org.w3c.dom.Node xmlNode, java.lang.Class targetType)
          Initializes a new instance of the DeserializationEvent class.
 
Method Summary
 GraphMLParseContext getContext()
          Gets the context in which the getXmlNode() shall be deserialized.
 java.lang.Object getResult()
          Holds the result of the deserialization, which is null initially.
 java.lang.Class getTargetType()
          Gets the type of the resulting instance that is required by the requesting deserializer or null if the target type is not known in advance.
 org.w3c.dom.Node getXmlNode()
          Gets the XML node that contains the data to deserialize.
 boolean isHandled()
          Gets a value indicating whether this DeserializationEvent is handled.
 void setHandled(boolean value)
          Sets a value indicating whether this DeserializationEvent is handled.
 void setResult(java.lang.Object value)
          Holds the result of the deserialization, which is null initially.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeserializationEvent

public DeserializationEvent(java.lang.Object source,
                            GraphMLParseContext context,
                            org.w3c.dom.Node xmlNode)
Initializes a new instance of the DeserializationEvent class.

This initializes the getTargetType()

Parameters:
source - The source where the event is raised.
context - The context in which serialization should take place.
xmlNode - The XML element that contains the data to deserialize.

DeserializationEvent

public DeserializationEvent(java.lang.Object source,
                            GraphMLParseContext context,
                            org.w3c.dom.Node xmlNode,
                            java.lang.Class targetType)
Initializes a new instance of the DeserializationEvent class.

Parameters:
source - The source where the event is raised.
context - The context in which serialization should take place.
xmlNode - The XML element that contains the data to deserialize.
targetType - optional getTargetType() of the getResult().
See Also:
GraphMLParseContext.deserialize(GraphMLParseContext,org.w3c.dom.Node,Class)
Method Detail

getTargetType

public java.lang.Class getTargetType()
Gets the type of the resulting instance that is required by the requesting deserializer or null if the target type is not known in advance.

Returns:
The type of the result.
See Also:
GraphMLParseContext.deserialize(GraphMLParseContext, org.w3c.dom.Node, Class)

getResult

public java.lang.Object getResult()
Holds the result of the deserialization, which is null initially.

This value is only meaningful if isHandled() is true.

Returns:
The final result of the deserialization.
See Also:
isHandled(), setResult(Object)

setResult

public void setResult(java.lang.Object value)
Holds the result of the deserialization, which is null initially.

Setting this property will automatically set the isHandled() property to true.

Parameters:
value - the result of the deserialization.
Throws:
java.lang.IllegalArgumentException - If the value is not assignable to getTargetType()
See Also:
getTargetType(), setHandled(boolean), getResult()

isHandled

public boolean isHandled()
Gets a value indicating whether this DeserializationEvent is handled.

Returns:
true if this event has been handled; false otherwise.
See Also:
setHandled(boolean), getResult()

setHandled

public void setHandled(boolean value)
Sets a value indicating whether this DeserializationEvent is handled.

Setting this property to true indicates to the event source that the getResult() has been assigned and that the event should not be propagated to further listeners.

Parameters:
value - true if this event has been handled; false otherwise.
See Also:
setResult(Object), isHandled()

getContext

public GraphMLParseContext getContext()
Gets the context in which the getXmlNode() shall be deserialized.

Returns:
The context.

getXmlNode

public org.w3c.dom.Node getXmlNode()
Gets the XML node that contains the data to deserialize.

Returns:
The XML node.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.