C# Class SimpleFramework.Xml.Core.TextLabel

The TextLabel represents a label that is used to get a converter for a text entry within an XML element. This label is used to convert an XML text entry into a primitive value such as a string or an integer, this will throw an exception if the field value does not represent a primitive object.
Inheritance: Label
Afficher le fichier Open project: ngallagher/simplexml

Méthodes publiques

Méthode 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

This is used to determine if the Text method or field is to have its value written as a CDATA block. This will set the output node to CDATA mode if this returns true, if it is false data will be written according to an inherited mode. By default inherited mode results in escaped XML text.

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 text entities are inline.

IsRequired ( ) : bool

This is used to determine whether the XML element is required. This ensures that if an XML element 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.

TextLabel ( Contact contact, Text label ) : SimpleFramework.Xml.Strategy

Constructor for the TextLabel object. This is used to create a label that can convert a XML node into a primitive value from an XML element text value.

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.

Method Details

GetConverter() public méthode

public GetConverter ( Context context ) : Converter
context Context /// this is the context object used for serialization ///
Résultat Converter

GetEmpty() public méthode

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 ///
Résultat String

GetName() public méthode

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 that is used for styling ///
Résultat String

IsAttribute() public méthode

public IsAttribute ( ) : bool
Résultat bool

IsCollection() public méthode

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
Résultat bool

IsData() public méthode

This is used to determine if the Text method or field is to have its value written as a CDATA block. This will set the output node to CDATA mode if this returns true, if it is false data will be written according to an inherited mode. By default inherited mode results in escaped XML text.
public IsData ( ) : bool
Résultat bool

IsInline() public méthode

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 text entities are inline.
public IsInline ( ) : bool
Résultat bool

IsRequired() public méthode

This is used to determine whether the XML element is required. This ensures that if an XML element 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
Résultat bool

TextLabel() public méthode

Constructor for the TextLabel object. This is used to create a label that can convert a XML node into a primitive value from an XML element text value.
public TextLabel ( Contact contact, Text label ) : SimpleFramework.Xml.Strategy
contact Contact /// this is the contact this label represents ///
label SimpleFramework.Xml.Text /// this is the annotation for the contact ///
Résultat SimpleFramework.Xml.Strategy

ToString() public méthode

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
Résultat String