C# Class FieldScanner, simplexml

The FieldScanner object is used to scan an class for fields marked with an XML annotation. All fields that contain an XML annotation are added as Contact objects to the list of contacts for the class. This scans the object by checking the class hierarchy, this allows a subclass to override a super class annotated field, although this should be used rarely.
Inheritance: ContactList
ファイルを表示 Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
Build ( ) : void

This is used to build a list of valid contacts for this scanner. Valid contacts are fields that are either defaulted or those that have an explicit XML annotation. Any field that has been marked as transient will not be considered as valid.

FieldScanner ( Class, type ) : SimpleFramework.Xml

Constructor for the FieldScanner object. This is used to perform a scan on the specified class in order to find all fields that are labeled with an XML annotation.

FieldScanner ( Class, type, DefaultType access ) : SimpleFramework.Xml

Constructor for the FieldScanner object. This is used to perform a scan on the specified class in order to find all fields that are labeled with an XML annotation.

Process ( Field, field, Annotation, label ) : void

This method is used to process the field an annotation given. This will check to determine if the field is accessible, if it is not accessible then it is made accessible so that private member fields can be used during the serialization process.

Process ( Field, field, Class, type ) : void

This method is used to process the field an annotation given. This will check to determine if the field is accessible, if it is not accessible then it is made accessible so that private member fields can be used during the serialization process.

Remove ( Field, field, Annotation, label ) : void

This is used to remove a field from the map of processed fields. A field is removed with the Transient annotation is used to indicate that it should not be processed by the scanner. This is required when default types are used.

Scan ( Class, type ) : void

This method is used to scan the class hierarchy for each class in order to extract fields that contain XML annotations. If the field is annotated it is converted to a contact so that it can be used during serialization and deserialization.

Scan ( Class, type, Class, real ) : void

This is used to scan the declared fields within the specified class. Each method will be check to determine if it contains an XML element and can be used as a Contact for an entity within the object.

Scan ( Class, type, DefaultType access ) : void

This is used to scan all the fields of the class in order to determine if it should have a default annotation. If the field should have a default XML annotation then it is added to the list of contacts to be used to form the class schema.

Scan ( Field, field ) : void

This is used to scan all annotations within the given field. Each annotation is checked against the set of supported XML annotations. If the annotation is one of the XML annotations then the field is considered for acceptance as a contact.

Scan ( Field, field, Annotation, label ) : void

This reflectively checks the annotation to determine the type of annotation it represents. If it represents an XML schema annotation it is used to create a Contact which can be used to represent the field within the source object.

Method Details

Build() public method

This is used to build a list of valid contacts for this scanner. Valid contacts are fields that are either defaulted or those that have an explicit XML annotation. Any field that has been marked as transient will not be considered as valid.
public Build ( ) : void
return void

FieldScanner() public method

Constructor for the FieldScanner object. This is used to perform a scan on the specified class in order to find all fields that are labeled with an XML annotation.
public FieldScanner ( Class, type ) : SimpleFramework.Xml
type Class, /// this is the schema class that is to be scanned ///
return SimpleFramework.Xml

FieldScanner() public method

Constructor for the FieldScanner object. This is used to perform a scan on the specified class in order to find all fields that are labeled with an XML annotation.
public FieldScanner ( Class, type, DefaultType access ) : SimpleFramework.Xml
type Class, /// this is the schema class that is to be scanned ///
access DefaultType /// this is the access type for the class ///
return SimpleFramework.Xml

Process() public method

This method is used to process the field an annotation given. This will check to determine if the field is accessible, if it is not accessible then it is made accessible so that private member fields can be used during the serialization process.
public Process ( Field, field, Annotation, label ) : void
field Field, /// this is the field to be added as a contact ///
label Annotation, /// this is the XML annotation used by the field ///
return void

Process() public method

This method is used to process the field an annotation given. This will check to determine if the field is accessible, if it is not accessible then it is made accessible so that private member fields can be used during the serialization process.
public Process ( Field, field, Class, type ) : void
field Field, /// this is the field to be added as a contact ///
type Class, /// this is the type to acquire the annotation ///
return void

Remove() public method

This is used to remove a field from the map of processed fields. A field is removed with the Transient annotation is used to indicate that it should not be processed by the scanner. This is required when default types are used.
public Remove ( Field, field, Annotation, label ) : void
field Field, /// this is the field to be removed from the map ///
label Annotation, /// this is the label associated with the field ///
return void

Scan() public method

This method is used to scan the class hierarchy for each class in order to extract fields that contain XML annotations. If the field is annotated it is converted to a contact so that it can be used during serialization and deserialization.
public Scan ( Class, type ) : void
type Class, /// this is the type to be scanned for fields ///
return void

Scan() public method

This is used to scan the declared fields within the specified class. Each method will be check to determine if it contains an XML element and can be used as a Contact for an entity within the object.
public Scan ( Class, type, Class, real ) : void
type Class, /// this is one of the super classes for the object ///
real Class, /// this is the actual type of the object scanned ///
return void

Scan() public method

This is used to scan all the fields of the class in order to determine if it should have a default annotation. If the field should have a default XML annotation then it is added to the list of contacts to be used to form the class schema.
public Scan ( Class, type, DefaultType access ) : void
type Class, /// this is the type to have its fields scanned ///
access DefaultType /// this is the default access type for the class ///
return void

Scan() public method

This is used to scan all annotations within the given field. Each annotation is checked against the set of supported XML annotations. If the annotation is one of the XML annotations then the field is considered for acceptance as a contact.
public Scan ( Field, field ) : void
field Field, /// the field to be scanned for XML annotations ///
return void

Scan() public method

This reflectively checks the annotation to determine the type of annotation it represents. If it represents an XML schema annotation it is used to create a Contact which can be used to represent the field within the source object.
public Scan ( Field, field, Annotation, label ) : void
field Field, /// the field that the annotation comes from ///
label Annotation, /// the annotation used to model the XML schema ///
return void