An IInputHandler implementation that uses an IMapper<K, V> instance to associate the values with the keys.
Implements
- I
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.
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.
MapperInputHandler
(keyType: Constructor<TKey>dataType: Constructor<TData>deserializerTargetType?: Constructor)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.
MapperInputHandler
(keyType: Constructor<TKey>
dataType: Constructor<TData>
deserializerTargetType?: Constructor
)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
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.
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.Defined in
InputHandlerBase.defaultExistsIf any default value is set (including
null), defaultExists is automatically set to true.final
Property Value
The default value.
Defined in
InputHandlerBase.defaultValueGets or sets the deserializer.
Gets or sets the deserializer.
final
Property Value
The deserializer.
Gets or sets the target deserialization type for the targetType property.
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.
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.
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.final
Property Value
true if the default value should be parsed; false otherwise. The default is true.Defined in
InputHandlerBase.parseDefaultValueGets or sets the parse precedence that is associated with this handler.
Gets or sets the parse precedence that is associated with this handler.
Gets or sets whether getDeserializationXmlNode returns either the 'data'/'default' element itself or its content.
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
Methods
Overridden to take the overrideDefaultValue property into account.
Overridden to take the overrideDefaultValue property into account.
Parameters
- context: IParseContext
- The context for the parse operation.
See Also
Overrides
InputHandlerBase.applyDefaultGets the node to pass to deserializer or IParseContext.Deserialize respectively, given the 'data' or 'default' element from the GraphML.
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
Initializes this instance from the GraphML key definition.
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 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
Defined in
InputHandlerBase.parseDataParses the data using either the deserializer or the deserializeCore call.
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' })
DeserializationNotSupportedExceptionif deserializer could not handle the node.
See Also
Overrides
InputHandlerBase.parseDataCoreThis method uses the mapper to associate the data with the key.
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.