|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.graphml.input.AbstractInputHandler y.io.graphml.input.AbstractDataAcceptorInputHandler y.io.graphml.input.ComplexDataAcceptorInputHandler
public class ComplexDataAcceptorInputHandler
An InputHandler
implementation that uses an DataAcceptor
instance to associate the values with the keys.
This implementation can be provided a custom DeserializationHandler
to perform the deserialization.
Constructor Summary | |
---|---|
ComplexDataAcceptorInputHandler()
Initializes a new instance of the ComplexDataAcceptorInputHandler class
that uses the GraphMLParseContext for deserialization. |
|
ComplexDataAcceptorInputHandler(DeserializationHandler deserializer)
Initializes a new instance of the ComplexDataAcceptorInputHandler class
that uses the event handler for deserialization. |
Method Summary | |
---|---|
protected org.w3c.dom.Node |
getDeserializationXmlNode(GraphMLParseContext context,
org.w3c.dom.Node node)
Gets the node to pass to deserializer or
GraphMLParseContext.deserialize(GraphMLParseContext, org.w3c.dom.Node, Class)
respectively, given the 'data' or 'default' element from the GraphML. |
DeserializationHandler |
getDeserializer()
Gets the custom deserializer. |
java.lang.Class |
getDeserializerTargetType()
Gets the target deserialization type for the DeserializationEvent.getTargetType()
property. |
boolean |
isUseParentElementForDeserialization()
Controls the behavior of getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
to return either the 'data' or 'default'
element itself or its content. |
protected java.lang.Object |
parseDataCore(GraphMLParseContext context,
org.w3c.dom.Node node)
Parses the data using either the deserializer or
GraphMLParseContext.deserialize(GraphMLParseContext, org.w3c.dom.Node, Class) |
void |
setDeserializer(DeserializationHandler value)
Sets a custom deserializer. |
void |
setDeserializerTargetType(java.lang.Class value)
Sets the target deserialization type for the DeserializationEvent.getTargetType()
property. |
void |
setUseParentElementForDeserialization(boolean value)
Controls the behavior of getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
to return either the 'data' or 'default' element
itself or its content. |
Methods inherited from class y.io.graphml.input.AbstractDataAcceptorInputHandler |
---|
getDataAcceptor, setDataAcceptor, setValue |
Methods inherited from class y.io.graphml.input.AbstractInputHandler |
---|
applyDefault, getDefaultValue, getPrecedence, getValidScopes, initializeFromKeyDefinition, isDefaultExists, isParseDefaultValue, parseData, setDefaultExists, setDefaultValue, setParseDefaultValue, setPrecedence, setValidScopes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComplexDataAcceptorInputHandler()
ComplexDataAcceptorInputHandler
class
that uses the GraphMLParseContext
for deserialization.
Data is parsed through GraphMLParseContext.deserialize(GraphMLParseContext,org.w3c.dom.Node,Class)
which
delegates to event listeners.
GraphMLParseContext.deserialize(GraphMLParseContext,org.w3c.dom.Node,Class)
public ComplexDataAcceptorInputHandler(DeserializationHandler deserializer)
ComplexDataAcceptorInputHandler
class
that uses the event handler for deserialization.
Data is parsed directly by the provided deserializer
, thus bypassing deserialization
through GraphMLParseContext.deserialize(GraphMLParseContext,org.w3c.dom.Node,Class)
. Use this variant
to locally override deserialization behaviour for a certain data attribute.
deserializer
- The deserialization callback that is used to parse the data.getDeserializer()
,
setDeserializer(DeserializationHandler)
,
DeserializationHandler.onHandleDeserialization(DeserializationEvent)
Method Detail |
---|
public boolean isUseParentElementForDeserialization()
getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
to return either the 'data'
or 'default'
element itself or its content.
The default value is false
, meaning that
getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
should return the content of the 'data'
or
'default' node.
true
iff the default
element should parsed itself.getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
,
setUseParentElementForDeserialization(boolean)
public void setUseParentElementForDeserialization(boolean value)
getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
to return either the 'data'
or 'default' element
itself or its content.
The default value is false
, meaning that
getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
should return the content of the 'data'
or
'default' node.
value
- a value that indicates whether to parse the default
element or its contentgetDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
,
isUseParentElementForDeserialization()
public DeserializationHandler getDeserializer()
setDeserializer(DeserializationHandler)
public void setDeserializer(DeserializationHandler value)
value
- The deserializer.getDeserializer()
public java.lang.Class getDeserializerTargetType()
DeserializationEvent.getTargetType()
property.
setDeserializerTargetType(Class)
public void setDeserializerTargetType(java.lang.Class value)
DeserializationEvent.getTargetType()
property.
value
- The target type of the deserialization.getDeserializerTargetType()
protected java.lang.Object parseDataCore(GraphMLParseContext context, org.w3c.dom.Node node) throws GraphMLParseException
deserializer
or
GraphMLParseContext.deserialize(GraphMLParseContext, org.w3c.dom.Node, Class)
parseDataCore
in class AbstractInputHandler
context
- The context.node
- The node that contains the data. This is either the GraphML
'data'
element or the 'default'
element,
depending on the return value of isUseParentElementForDeserialization()
GraphMLParseException
getDeserializationXmlNode(GraphMLParseContext, org.w3c.dom.Node)
,
isUseParentElementForDeserialization()
protected org.w3c.dom.Node getDeserializationXmlNode(GraphMLParseContext context, org.w3c.dom.Node node) throws GraphMLParseException
deserializer
or
GraphMLParseContext.deserialize(GraphMLParseContext, org.w3c.dom.Node, Class)
respectively, given the 'data' or 'default' element from the GraphML.
This method is called by parseDataCore(GraphMLParseContext, org.w3c.dom.Node)
to determine the node to pass to the deserialization mechanism.
node
iff isUseParentElementForDeserialization()
is true
(i.e. the 'data'
or 'default'
node itself), otherwise the Node.getFirstChild()
of the node
.
context
- The context within which the node is parsed.node
- The 'data' or 'default' node.
GraphMLParseException
isUseParentElementForDeserialization()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |