Package org.simpleframework.xml.core
Class TextList
java.lang.Object
org.simpleframework.xml.core.TextList
This
TextList
object is a converter that is used
to read free text and insert that text in to a list. Collecting
free text in this way allows unstructured XML to be processed
and stored in an ordered way, which will allow it to be written
as identical XML during the serialization process.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CollectionFactory
This is the factory that is used to create the containing list.private final Primitive
This is the primitive object used to read the free text.private final Type
This is a string type which is used for all free text data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTheread
method reads an object to a specific type from the provided node.Theread
method reads an object to a specific type from the provided node.boolean
Thevalidate
method is used to validate the class XML schema against an input source.void
write
(OutputNode node, Object object) Thewrite
method writes the fields from the given object to the XML element.
-
Field Details
-
factory
This is the factory that is used to create the containing list. -
primitive
This is the primitive object used to read the free text. -
type
This is a string type which is used for all free text data.
-
-
Constructor Details
-
TextList
Constructor for theTextList
object. This is used to create a converter that can read free text from between elements in anElementListUnion
. Converting the free text in this way allows unstructured XML to be processed.- Parameters:
context
- this is the context that is used for thislist
- this is the list type this will be used withlabel
- this is the label this the text is declared with
-
-
Method Details
-
read
Theread
method reads an object to a specific type from the provided node. If the node provided is an attribute then the object must be a primitive such as a string, integer, boolean, or any of the other Java primitive types. -
read
Theread
method reads an object to a specific type from the provided node. If the node provided is an attribute then the object must be a primitive such as a string, integer, boolean, or any of the other Java primitive types.- Specified by:
read
in interfaceConverter
- Specified by:
read
in interfaceRepeater
- Parameters:
node
- contains the details used to deserialize the objectresult
- this is the value to read the objects in tovalue
- this is the value to read the objects in to- Returns:
- a fully deserialized object will all its fields
- Throws:
Exception
- if a deserialized type cannot be instantiated
-
validate
Thevalidate
method is used to validate the class XML schema against an input source. This will traverse the class fields and methods ensuring that the input XML document contains a valid structure when compared against the class XML schema. -
write
Thewrite
method writes the fields from the given object to the XML element. After this has finished the element contains all attributes and sub-elements from the object.
-