Package org.simpleframework.xml.core
Class Collector
- java.lang.Object
-
- org.simpleframework.xml.core.Collector
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>
,Criteria
class Collector extends java.lang.Object implements Criteria
TheCollector
object is used to store variables for a deserialized object. Each variable contains the label and value for a field or method. TheComposite
object uses this to store deserialized values before committing them to the objects methods and fields.- See Also:
Composite
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Collector.Registry
TheRegistry
object is used to store variables for the collector.
-
Field Summary
Fields Modifier and Type Field Description private Collector.Registry
alias
This is the registry that contains variables mapped to paths.private Collector.Registry
registry
This is the registry containing all the variables collected.
-
Constructor Summary
Constructors Constructor Description Collector()
Constructor for theCollector
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(java.lang.Object source)
This is used to set the values for the methods and fields of the specified object.Variable
get(java.lang.Object key)
This is used to get theVariable
that represents a deserialized object.Variable
get(Label label)
This is used to get theVariable
that represents a deserialized object.java.util.Iterator<java.lang.Object>
iterator()
This is used to acquire an iterator over the named variables.Variable
remove(java.lang.Object key)
This is used to remove theVariable
from this criteria object.Variable
resolve(java.lang.String path)
This is used to resolve theVariable
by using the union names of a label.void
set(Label label, java.lang.Object value)
This is used to create aVariable
and set it for this criteria.
-
-
-
Field Detail
-
registry
private final Collector.Registry registry
This is the registry containing all the variables collected.
-
alias
private final Collector.Registry alias
This is the registry that contains variables mapped to paths.
-
-
Method Detail
-
get
public Variable get(java.lang.Object key)
This is used to get theVariable
that represents a deserialized object. The variable contains all the meta data for the field or method and the value that is to be set on the method or field.
-
get
public Variable get(Label label) throws java.lang.Exception
This is used to get theVariable
that represents a deserialized object. The variable contains all the meta data for the field or method and the value that is to be set on the method or field.
-
resolve
public Variable resolve(java.lang.String path)
This is used to resolve theVariable
by using the union names of a label. This will also acquire variables based on the actual name of the variable.
-
remove
public Variable remove(java.lang.Object key) throws java.lang.Exception
This is used to remove theVariable
from this criteria object. When removed, the variable will no longer be used to set the method or field when thecommit
method is invoked.
-
iterator
public java.util.Iterator<java.lang.Object> iterator()
This is used to acquire an iterator over the named variables. Providing anIterator
allows the criteria to be used in a for each loop. This is primarily for convenience.- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Object>
- Returns:
- this returns an iterator of all the variable names
-
set
public void set(Label label, java.lang.Object value) throws java.lang.Exception
This is used to create aVariable
and set it for this criteria. The variable can be retrieved at a later stage using the name of the label. This allows for repeat reads as the variable can be used to acquire the labels converter.
-
commit
public void commit(java.lang.Object source) throws java.lang.Exception
This is used to set the values for the methods and fields of the specified object. Invoking this performs the population of an object being deserialized. It ensures that each value is set after the XML element has been fully read.
-
-