Package org.simpleframework.xml.core
Class CompositeValue
java.lang.Object
org.simpleframework.xml.core.CompositeValue
- All Implemented Interfaces:
Converter
The
CompositeValue
object is used to convert an object
to an from an XML element. This accepts only composite objects and
will maintain all references within the object using the cycle
strategy if required. This also ensures that should the value to
be written to the XML element be null that nothing is written.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Context
This is the context used to support the serialization process.private final Entry
This is the entry object used to provide configuration details.private final Traverser
This is the traverser used to read and write the value with.private final Style
This is the style used to style the names used for the XML.private final Type
This represents the type of object the value is written as. -
Constructor Summary
ConstructorsConstructorDescriptionCompositeValue
(Context context, Entry entry, Type type) Constructor for theCompositeValue
object. -
Method Summary
Modifier and TypeMethodDescriptionThis method is used to read the value object from the node.This method is used to read the value object from the node.boolean
This method is used to read the value object from the node.private boolean
This method is used to read the value object from the node.void
write
(OutputNode node, Object item) This method is used to write the value to the specified node.
-
Field Details
-
context
This is the context used to support the serialization process. -
root
This is the traverser used to read and write the value with. -
style
This is the style used to style the names used for the XML. -
entry
This is the entry object used to provide configuration details. -
type
This represents the type of object the value is written as.
-
-
Constructor Details
-
CompositeValue
Constructor for theCompositeValue
object. This will create an object capable of reading an writing composite values from an XML element. This also allows a parent element to be created to wrap the key object if desired.- Parameters:
context
- this is the root context for the serializationentry
- this is the entry object used for configurationtype
- this is the type of object the value represents- Throws:
Exception
-
-
Method Details
-
read
This method is used to read the value object from the node. The value read from the node is resolved using the template filter. If the value data can not be found according to the annotation attributes then null is assumed and returned. -
read
This method is used to read the value object from the node. The value read from the node is resolved using the template filter. If the value data can not be found according to the annotation attributes then null is assumed and returned. -
validate
This method is used to read the value object from the node. The value read from the node is resolved using the template filter. If the value data can not be found according to the annotation attributes then null is assumed and the node is valid. -
validate
This method is used to read the value object from the node. The value read from the node is resolved using the template filter. If the value data can not be found according to the annotation attributes then null is assumed and the node is valid.- Parameters:
node
- this is the node to read the value object fromkey
- this is the name of the value element- Returns:
- this returns true if this represents a valid value
- Throws:
Exception
-
write
This method is used to write the value to the specified node. The value written to the node must be a composite object and if the object provided to this is null then nothing is written.
-