Package org.simpleframework.xml.core
Class Composite.Injector
java.lang.Object
org.simpleframework.xml.core.Composite.Builder
org.simpleframework.xml.core.Composite.Injector
- Enclosing class:
Composite
This takes the approach that the objects are deserialized first
then the instance is created using a constructor. In order for
the best constructor to be found all the potential objects need
to be deserialized first, then based on what has been deserialized
a constructor is chosen and the parameters are injected in to it.
-
Field Summary
Fields inherited from class org.simpleframework.xml.core.Composite.Builder
composite, criteria, schema, value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThisread
method performs deserialization of the XML schema class type by traversing the contacts and using details from the provided XML element.private Object
readInject
(InputNode node) ThisreadInject
method performs deserialization of the XML schema class type by traversing the contacts and creating them using details from the provided XML element.
-
Constructor Details
-
Injector
Constructor for theInjector
object. This creates a builder object capable of instantiating a object using a constructor. It injects the constructor parameters in to the constructor by using the deserialized objects.- Parameters:
composite
- this is the composite object used by thiscriteria
- this collects the objects being deserializedschema
- this is the class schema used by thisvalue
- this is the instance created by the strategy
-
-
Method Details
-
read
Thisread
method performs deserialization of the XML schema class type by traversing the contacts and using details from the provided XML element. Here an instance is instantiated only after everything has been deserialized so that the instances can be injected in to a constructor.- Overrides:
read
in classComposite.Builder
- Parameters:
node
- the XML element that will be deserialized by this- Returns:
- this returns the fully deserialized object graph
- Throws:
Exception
-
readInject
ThisreadInject
method performs deserialization of the XML schema class type by traversing the contacts and creating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.This takes the approach of reading the elements and attributes before instantiating the object. Instantiation is performed using a declared constructor. The parameters are taken from the deserialized objects.
- Parameters:
node
- the XML element that will be deserialized by this- Returns:
- this returns the fully deserialized object graph
- Throws:
Exception
-