C

MapperOutputHandler<TKey, TData>

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.
ImplementsInheritance Hierarchy

Members

Show:

Constructors

Initializes a new instance of the MapperOutputHandler<TKey, TData> class using the provided key scope, the name, and the key type.

Parameters

keyType: Constructor<TKey>
The type of the keys.
dataType: Constructor<TData>
The type of the data.
scope: KeyScope
The scope for the key definition attributes.
name: string
The name for the key definition attributes.
type: KeyType
The type for the key definition attributes.

Properties

Gets the XML attributes that should be added to the data element.
Gets or sets a value indicating whether a default value has been assigned.
final

Property Value

true if a default value has been assigned, false otherwise.
Gets or sets the default value.
Setting this value also sets the defaultExists property.
final

Property Value

The default value.
Gets the XML attributes that should be added to the key definition in the GraphML key element.
Gets or sets the mapper to use for querying the data for each item.
conversionfinal

Property Value

The mapper.
Gets or sets the write precedence for the handler.
conversionfinal

Property Value

The write precedence.
Gets or sets the serialization callback to use for serializing the value in writeValueCore.
final

Property Value

The serialization callback or null to indicate that the context should be used instead.

See Also

API
sourceType
Gets or sets the source type of the serialization.
This type will be used as the sourceType.
final

Property Value

The desired type of the object that is serialized.

See Also

API
serializer, HandleSerializationEventArgs
Gets or sets a value indicating whether to write the key default.
final

Property Value

true if the key default should be written; false otherwise.

Methods

Obtains the data for the given key.
protected

Parameters

context: IWriteContext
The context.
key: TKey
The key.

Return Value

TData
The data that is associated with the key using the mapper.
Determines whether in the current context, the value is the default value and therefore no data element needs to be written.
This implementation will return 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

context: IWriteContext
The context.

Return Value

boolean
true if for the current context the default value applies and therefore no data element needs to be written.
Sets the name for the key definition.
final

Parameters

name: string
The name of the key element.
Sets the scope for the key definition.
Note that the official GraphML schema does not support the GRAPHML so this implementation will silently ignore this, which will result in ALL implicitly being defined.
final

Parameters

scope: KeyScope
The scope of the key element.
Sets the key type for the key definition.
final

Parameters

type: KeyType
The type of the key element.
Sets an optional URI for the key definition.
By default, no URI is set.
final

Parameters

uri: string
The URI of the key element.
Writes the contents of the key definition.
Depending on whether writeKeyDefault is enabled and defaultExists is true, this method will write the GraphML 'default' element and use writeValueCore to serialize the defaultValue.

Parameters

context: IWriteContext
The context.
Actually writes the value for the current context.
This method will use getValue to obtain the data and delegate to writeValueCore to perform the actual serialization.
final

Parameters

context: IWriteContext
The context.
Performs the actual writing of the data using either the serializer or the serializeCore method.
protected

Parameters

context: IWriteContext
The context to use for writing.
data: TData
The data to write.