C# Класс SimpleFramework.Xml.Core.CompositeInlineList

The CompositeInlineList object is used to convert an group of elements in to a collection of element entries. This is used when a containing element for a list is not required. It extracts the elements by matching elements to name of the type that the annotated field or method requires. This enables these element entries to exist as siblings to other objects within the object. One restriction is that the Root annotation for each of the types within the list must be the same. <entry attribute="one"> <text>example text value</text> </entry> <entry attribute="two"> <text>some other example</text> </entry> <entry attribute="three"> <text>yet another example</text> </entry> For the above XML element list the element entry is contained within the list. Each entry element is thus deserialized as a root element and then inserted into the list. This enables lists to be composed from XML documents. For serialization the reverse is done, each element taken from the collection is written as a root element to the owning element to create the list. Entry objects do not need to be of the same type.
Наследование: Repeater
Показать файл Открыть проект

Открытые методы

Метод Описание
CompositeInlineList ( Context context, Type type, Type entry, String name ) : SimpleFramework.Xml.Strategy

Constructor for the CompositeInlineList object. This is given the list type and entry type to be used. The list type is the Collection implementation that is used to collect the deserialized entry objects from the XML source.

Read ( InputNode node ) : Object

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.

Read ( InputNode node, Class expect ) : Object

This read method will read the XML element from the provided node. This checks to ensure that the deserialized type is the same as the entry type provided. If the types are not the same then an exception is thrown. This is done to ensure each node in the collection contain the same root annotation.

Read ( InputNode node, Collection list ) : Object

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.

Read ( InputNode node, Object value ) : Object

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.

Validate ( InputNode node ) : bool

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.

Write ( OutputNode node, Collection list ) : void

This write method will write the specified object to the given XML element as as list entries. Each entry within the given collection must be assignable from the annotated type specified within the ElementList annotation. Each entry is serialized as a root element, that is, its Root annotation is used to extract the name.

Write ( OutputNode node, Object source ) : void

This write method will write the specified object to the given XML element as as list entries. Each entry within the given collection must be assignable from the annotated type specified within the ElementList annotation. Each entry is serialized as a root element, that is, its Root annotation is used to extract the name.

Описание методов

CompositeInlineList() публичный Метод

Constructor for the CompositeInlineList object. This is given the list type and entry type to be used. The list type is the Collection implementation that is used to collect the deserialized entry objects from the XML source.
public CompositeInlineList ( Context context, Type type, Type entry, String name ) : SimpleFramework.Xml.Strategy
context Context /// this is the context object used for serialization ///
type System.Type /// this is the collection type for the list used ///
entry System.Type /// the entry type to be stored within the list ///
name String /// this is the name of the entries used for this list ///
Результат SimpleFramework.Xml.Strategy

Read() публичный Метод

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.
public Read ( InputNode node ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
Результат Object

Read() публичный Метод

This read method will read the XML element from the provided node. This checks to ensure that the deserialized type is the same as the entry type provided. If the types are not the same then an exception is thrown. This is done to ensure each node in the collection contain the same root annotation.
public Read ( InputNode node, Class expect ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
expect Class /// this is the type expected of the deserialized type ///
Результат Object

Read() публичный Метод

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.
public Read ( InputNode node, Collection list ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
list Collection /// this is the collection that is to be populated ///
Результат Object

Read() публичный Метод

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.
public Read ( InputNode node, Object value ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
value Object
Результат Object

Validate() публичный Метод

This read method wll read the XML element list from the provided node and deserialize its children as entry types. This will each entry type is deserialized as a root type, that is, its Root annotation must be present and the name of the entry element must match that root element name.
public Validate ( InputNode node ) : bool
node InputNode /// this is the XML element that is to be deserialized ///
Результат bool

Write() публичный Метод

This write method will write the specified object to the given XML element as as list entries. Each entry within the given collection must be assignable from the annotated type specified within the ElementList annotation. Each entry is serialized as a root element, that is, its Root annotation is used to extract the name.
public Write ( OutputNode node, Collection list ) : void
node OutputNode /// this is the XML element container to be populated ///
list Collection /// this is the source collection to be serialized ///
Результат void

Write() публичный Метод

This write method will write the specified object to the given XML element as as list entries. Each entry within the given collection must be assignable from the annotated type specified within the ElementList annotation. Each entry is serialized as a root element, that is, its Root annotation is used to extract the name.
public Write ( OutputNode node, Object source ) : void
node OutputNode /// this is the XML element container to be populated ///
source Object /// this is the source collection to be serialized ///
Результат void