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 CollectionFactoryThis is the factory that is used to create the containing list.private final PrimitiveThis is the primitive object used to read the free text.private final TypeThis is a string type which is used for all free text data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThereadmethod reads an object to a specific type from the provided node.Thereadmethod reads an object to a specific type from the provided node.booleanThevalidatemethod is used to validate the class XML schema against an input source.voidwrite(OutputNode node, Object object) Thewritemethod 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 theTextListobject. 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
Thereadmethod 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
Thereadmethod 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:
readin interfaceConverter- Specified by:
readin 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
Thevalidatemethod 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
Thewritemethod 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.
-