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
Constructors
MapperOutputHandler
(keyType: Constructor<TKey>, dataType: Constructor<TData>, scope: KeyScope, name: string, type: KeyType)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.
Property Value
true
if a default value has been assigned, false
otherwise.Defined in
Gets or sets the default value.
Remarks
Property Value
Defined in
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.
Property Value
Gets or sets the write precedence for the handler.
Gets or sets the serialization callback to use for serializing the value in writeValueCore.
Property Value
null
to indicate that the context should be used instead.Signature Details
function(arg1: IWriteContext, arg2: TData, arg3: Constructor)
Parameters
- arg1 - IWriteContext
- The first parameter of the method that this delegate encapsulates.
- arg2 - TData
- The second parameter of the method that this delegate encapsulates.
- arg3 - Constructor
- The third parameter of the method that this delegate encapsulates.
See Also
Gets or sets the source type of the serialization.
Remarks
Property Value
See Also
Gets or sets a value indicating whether to write the key default.
Property Value
true
if the key default should be written; false
otherwise.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.
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
true
, this method will write the GraphML 'default' element and use writeValueCore to serialize the defaultValue.Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
Implements
Actually writes the value for the current context.
Remarks
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The context.
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.