C# Class SimpleFramework.Xml.Core.ElementMapLabel

The ElementMapLabel represents a label that is used to represent an XML element map in a class schema. This element list label can be used to convert an XML node into a map object of composite or primitive key value pairs. Each element converted with the converter this creates must be an XML serializable element.
Inheritance: Label
显示文件 Open project: ngallagher/simplexml

Public Methods

Method Description
ElementMapLabel ( Contact contact, ElementMap label ) : SimpleFramework.Xml.Strategy

Constructor for the ElementMapLabel object. This creates a label object, which can be used to convert an XML node to a Map of XML serializable objects.

GetConverter ( Context context ) : Converter
GetEmpty ( Context context ) : Object

This is used to provide a configured empty value used when the annotated value is null. This ensures that XML can be created with required details regardless of whether values are null or not. It also provides a means for sensible default values.

GetName ( Context context ) : String

This is used to acquire the name of the element or attribute that is used by the class schema. The name is determined by checking for an override within the annotation. If it contains a name then that is used, if however the annotation does not specify a name the the field or method name is used instead.

Method Details

ElementMapLabel() public method

Constructor for the ElementMapLabel object. This creates a label object, which can be used to convert an XML node to a Map of XML serializable objects.
public ElementMapLabel ( Contact contact, ElementMap label ) : SimpleFramework.Xml.Strategy
contact Contact /// this is the contact that this label represents ///
label SimpleFramework.Xml.ElementMap /// the annotation that contains the schema details ///
return SimpleFramework.Xml.Strategy

GetConverter() public method

public GetConverter ( Context context ) : Converter
context Context /// this is the context object for the serialization ///
return Converter

GetEmpty() public method

This is used to provide a configured empty value used when the annotated value is null. This ensures that XML can be created with required details regardless of whether values are null or not. It also provides a means for sensible default values.
public GetEmpty ( Context context ) : Object
context Context /// this is the context object for the serialization ///
return Object

GetName() public method

This is used to acquire the name of the element or attribute that is used by the class schema. The name is determined by checking for an override within the annotation. If it contains a name then that is used, if however the annotation does not specify a name the the field or method name is used instead.
public GetName ( Context context ) : String
context Context /// this is the context used to style the name ///
return String