C

MapperInputHandler<TKey, TData>

An IInputHandler implementation that uses an IMapper<K, V> instance to associate the values with the keys.
ImplementsInheritance Hierarchy

Remarks

This implementation can be provided a HandleDeserializationEventArgs-handler to perform the deserialization. If no such value is provided then the default deserialization is performed.

The parsed values are stored in an IMapper<K, V>.

Type Parameters

TKey

The type of the key.

TData

The type of the value.

Members

Show:

Constructors

Initializes a new instance of the MapperInputHandler<TKey, TData> class that uses the IParseContext for deserialization.
The precedence has an initial value of DEFAULT.

Parameters

keyType: Constructor<TKey>
The type of the key.
dataType: Constructor<TData>
The type of the value.
Initializes a new instance of the MapperInputHandler<TKey, TData> class that uses the provided callback for deserialization and suggests the provided target type for the deserializer.

Parameters

keyType: Constructor<TKey>
The type of the key.
dataType: Constructor<TData>
The type of the value.
deserializer: function(IParseContext, Node, Constructor): TData
The callback used to deserialize.
deserializerTargetType?: Constructor
The type that should be suggested for the deserializer.

See Also

API
deserializerTargetType, deserializer

Properties

Gets a value indicating whether a default value has been set, either through a key definition element or explicitly by assigning a value to the defaultValue property.
If this property is set to true, the applyDefault method will call the setValue method using the defaultValue as the value parameter.
readonlyfinal

Property Value

true if the default value exists; false otherwise.
Gets or sets the default value that will be applied to the keys where the data attribute is missing.
If any default value is set (including null), defaultExists is automatically set to true.
final

Property Value

The default value.
Gets or sets the deserializer.
final

Property Value

The deserializer.
Gets or sets the target deserialization type for the targetType property.
final

Property Value

The target type of the deserialization.
Gets or sets the mapper to use for storing the data.
conversionfinal

Property Value

The mapper.
Gets or sets a value indicating whether values that are applied via the applyDefault mechanism and are equal to the value that is already present in the mapper will explicitly be overridden in the mapper.
final

Property Value

true if default values should be overridden in the mapper; false otherwise. By default this is set to false.
Gets or sets a value indicating whether the default value in the key definition should be parsed.
final

Property Value

true if the default value should be parsed; false otherwise. The default is true.
Gets or sets the parse precedence that is associated with this handler.
conversionfinal

Property Value

The parse precedence.
Gets or sets whether getDeserializationXmlNode returns either the 'data'/'default' element itself or its content.
The default value is false, meaning that getDeserializationXmlNode should return the content of the 'data'/'default' node.
final

See Also

API
getDeserializationXmlNode

Methods

Overridden to take the overrideDefaultValue property into account.

Parameters

context: IParseContext
The context for the parse operation.

See Also

API
overrideDefaultValue, applyDefault
Gets the node to pass to deserializer or IParseContext.Deserialize respectively, given the 'data' or 'default' element from the GraphML.

This method is called by parseDataCore to determine the node to pass to the deserialization mechanism.

This implementation returns node iff useParentElementForDeserialization is true (i.e. the 'data' or 'default' node itself), otherwise the first child of the node that is not a comment or processing instruction.

protected

Parameters

context: IParseContext
The context within which the node is parsed.
node: Node
The 'data' or 'default' node.

Return Value

Node
The node that should be deserialized.

See Also

API
useParentElementForDeserialization
Initializes this instance from the GraphML key definition.
This implementation looks for the GraphML default element and delegates to parseDataCore if a default is found to store the defaultValue.

Parameters

context: IParseContext
The context.
definition: Element
The definition.
This method is invoked each time a data element with a matching key is processed.
This method delegates the actual parsing to parseDataCore and sets the value afterwards. If the current element is of the same type as this TKey, it is used as the key parameter in the setValue call. Otherwise, null is passed as the key so the data can be stored temporarily until the key element is created.

Parameters

context: IParseContext
The current parse context.
node: Node
The DOM node representing the data element.

See Also

API
CreationProperties
Parses the data using either the deserializer or the deserializeCore call.
protected

Parameters

context: IParseContext
The context.
node: Node
The node that contains the data. This is either the GraphML 'data' element or the 'default' element.

Return Value

TData
The parsed data.

Throws

Exception ({ name: 'DeserializationNotSupportedError' })
DeserializationNotSupportedException if deserializer could not handle the node.

See Also

API
getDeserializationXmlNode
This method uses the mapper to associate the data with the key.
protected

Parameters

context: IParseContext
The context.
key: TKey
The key.
data: TData
The data.