GetKey() public method

This is used to get the key converter for the entry. This knows whether the key type is a primitive or composite object and will provide the appropriate converter implementation. This allows the root composite map converter to concern itself with only the details of the surrounding entry object.
public GetKey ( Context context ) : Converter
context Context /// this is the root context for the serialization ///
return Converter
Beispiel #1
0
 /// <summary>
 /// Constructor for the <c>CompositeMap</c> object. This will
 /// create a converter that is capable of writing map objects to
 /// and from XML. The resulting XML is configured by an annotation
 /// such that key values can attributes and values can be inline.
 /// </summary>
 /// <param name="context">
 /// this is the root context for the serialization
 /// </param>
 /// <param name="entry">
 /// this provides configuration for the resulting XML
 /// </param>
 /// <param name="type">
 /// this is the map type that is to be converted
 /// </param>
 public CompositeInlineMap(Context context, Entry entry, Type type)
 {
     this.factory = new MapFactory(context, type);
     this.value   = entry.GetValue(context);
     this.key     = entry.GetKey(context);
     this.style   = context.getStyle();
     this.entry   = entry;
 }
Beispiel #2
0
 /// <summary>
 /// Constructor for the <c>CompositeMap</c> object. This will
 /// create a converter that is capable of writing map objects to
 /// and from XML. The resulting XML is configured by an annotation
 /// such that key values can attributes and values can be inline.
 /// </summary>
 /// <param name="context">
 /// this is the root context for the serialization
 /// </param>
 /// <param name="entry">
 /// this provides configuration for the resulting XML
 /// </param>
 /// <param name="type">
 /// this is the map type that is to be converted
 /// </param>
 public CompositeMap(Context context, Entry entry, Type type) {
    this.factory = new MapFactory(context, type);
    this.value = entry.GetValue(context);
    this.key = entry.GetKey(context);
    this.style = context.getStyle();
    this.entry = entry;
 }