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
private class Composite.Injector extends Composite.Builder
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
read(InputNode node)
Thisread
method performs deserialization of the XML schema class type by traversing the contacts and using details from the provided XML element.private java.lang.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 Detail
-
Injector
private Injector(Composite composite, Criteria criteria, Schema schema, Instance value)
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 Detail
-
read
public java.lang.Object read(InputNode node) throws java.lang.Exception
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:
java.lang.Exception
-
readInject
private java.lang.Object readInject(InputNode node) throws java.lang.Exception
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:
java.lang.Exception
-
-