C# Class SimpleFramework.Xml.Core.VersionLabel

The VersionLabel object is used convert any double retrieved from an XML attribute to a version revision. The version is used to determine how to perform serialization of a composite by determining version compatibility.
Inheritance: Label
Mostra file Open project: ngallagher/simplexml

Public Methods

Method Description
GetConverter ( Context context ) : Converter
GetEmpty ( Context context ) : String

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.

IsAttribute ( ) : bool
IsCollection ( ) : bool

This is used to determine if the label is a collection. If the label represents a collection then any original assignment to the field or method can be written to without the need to create a new collection. This allows obscure collections to be used and also allows initial entries to be maintained.

IsData ( ) : bool

Because the attribute can contain only simple text values it is never required to specified as anything other than text. Therefore this will always return false as CDATA does not apply to the attribute values.

IsInline ( ) : bool

This method is used by the deserialization process to check to see if an annotation is inline or not. If an annotation represents an inline XML entity then the deserialization and serialization process ignores overrides and special attributes. By default all attributes are not inline items.

IsRequired ( ) : bool

This is used to determine whether the attribute is required. This ensures that if an attribute is missing from a document that deserialization can continue. Also, in the process of serialization, if a value is null it does not need to be written to the resulting XML document.

ToString ( ) : String

This is used to describe the annotation and method or field that this label represents. This is used to provide error messages that can be used to debug issues that occur when processing a method. This will provide enough information such that the problem can be isolated correctly.

VersionLabel ( Contact contact, Version label ) : SimpleFramework.Xml.Strategy

Constructor for the VersionLabel object. This is used to create a label that can convert from a double to an XML attribute and vice versa. This requires the annotation and contact extracted from the XML schema class.

Method Details

GetConverter() public method

public GetConverter ( Context context ) : Converter
context Context /// this is context object used for 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 ) : String
context Context /// this is the context object for the serialization ///
return String

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 /// the context object used to style the name ///
return String

IsAttribute() public method

public IsAttribute ( ) : bool
return bool

IsCollection() public method

This is used to determine if the label is a collection. If the label represents a collection then any original assignment to the field or method can be written to without the need to create a new collection. This allows obscure collections to be used and also allows initial entries to be maintained.
public IsCollection ( ) : bool
return bool

IsData() public method

Because the attribute can contain only simple text values it is never required to specified as anything other than text. Therefore this will always return false as CDATA does not apply to the attribute values.
public IsData ( ) : bool
return bool

IsInline() public method

This method is used by the deserialization process to check to see if an annotation is inline or not. If an annotation represents an inline XML entity then the deserialization and serialization process ignores overrides and special attributes. By default all attributes are not inline items.
public IsInline ( ) : bool
return bool

IsRequired() public method

This is used to determine whether the attribute is required. This ensures that if an attribute is missing from a document that deserialization can continue. Also, in the process of serialization, if a value is null it does not need to be written to the resulting XML document.
public IsRequired ( ) : bool
return bool

ToString() public method

This is used to describe the annotation and method or field that this label represents. This is used to provide error messages that can be used to debug issues that occur when processing a method. This will provide enough information such that the problem can be isolated correctly.
public ToString ( ) : String
return String

VersionLabel() public method

Constructor for the VersionLabel object. This is used to create a label that can convert from a double to an XML attribute and vice versa. This requires the annotation and contact extracted from the XML schema class.
public VersionLabel ( Contact contact, Version label ) : SimpleFramework.Xml.Strategy
contact Contact /// this is the field from the XML schema class ///
label Version /// represents the annotation for the field ///
return SimpleFramework.Xml.Strategy