An implementation of the OutputHandlerBase<TKey,TData> class, that uses an IMapper<K,V> to retrieve the values to output for each item and a serializer callback for the serialization or delegates to the serializeCore callback.
Type Parameters
- TKey
- The type of the keys.
- TData
- The type of the data.
Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.MapperOutputHandler
Constructors
Initializes a new instance of the MapperOutputHandler<TKey,TData> class using the provided key scope, the name, and the key type.
Parameters
A map of options to pass to the method.
Properties
Gets the XML attributes that should be added to the data element.
Implements
Gets or sets a value indicating whether a default value has been assigned.
Defined in
Gets or sets the default value.
Gets the XML attributes that should be added to the key definition in the GraphML key element.
Implements
Gets or sets the mapper to use for querying the data for each item.
Gets or sets the mapper metadata to serialize to the key definition.
Gets or sets the write precedence for the handler.
Gets or sets the serialization callback to use for serializing the value in writeValueCore.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
See Also
Gets or sets the source type of the serialization.
Gets or sets a value indicating whether to write the key default.
Defined in
Methods
Obtains the data for the given key.
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
- key - TKey
- The key.
Returns
- ↪TData
- The data that is associated with the key using the mapper.
See Also
Implements
Determines whether in the current context, the value is the default value and therefore no data element needs to be written.
Remarks
false
if no default has been set. Otherwise it will use getValue and compare the result with the defaultValue to determine whether they are equal and therefore no data needs to be written.Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
Returns
- ↪boolean
true
if for the current context the default value applies and therefore no data element needs to be written.
Implements
Sets the name for the key definition.
Parameters
A map of options to pass to the method.
- name - string
- The name of the key element.
Defined in
Sets the scope for the key definition.
Sets the key type for the key definition.
Parameters
A map of options to pass to the method.
- type - KeyType
- The type of the key element.
Defined in
Sets an optional URI for the key definition.
Remarks
Parameters
A map of options to pass to the method.
- uri - string
- The URI of the key element.
Defined in
Writes the contents of the key definition.
Remarks
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
Overrides
Actually writes the value for the current context.
Remarks
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
See Also
Implements
Performs the actual writing of the data using either the serializer or the serializeCore method.
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context to use for writing.
- data - TData
- The data to write.