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
TheCollectorobject is used to store variables for a deserialized object. Each variable contains the label and value for a field or method. TheCompositeobject 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 classCollector.RegistryTheRegistryobject is used to store variables for the collector.
-
Field Summary
Fields Modifier and Type Field Description private Collector.RegistryaliasThis is the registry that contains variables mapped to paths.private Collector.RegistryregistryThis is the registry containing all the variables collected.
-
Constructor Summary
Constructors Constructor Description Collector()Constructor for theCollectorobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(java.lang.Object source)This is used to set the values for the methods and fields of the specified object.Variableget(java.lang.Object key)This is used to get theVariablethat represents a deserialized object.Variableget(Label label)This is used to get theVariablethat represents a deserialized object.java.util.Iterator<java.lang.Object>iterator()This is used to acquire an iterator over the named variables.Variableremove(java.lang.Object key)This is used to remove theVariablefrom this criteria object.Variableresolve(java.lang.String path)This is used to resolve theVariableby using the union names of a label.voidset(Label label, java.lang.Object value)This is used to create aVariableand 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 theVariablethat 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 theVariablethat 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 theVariableby 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 theVariablefrom this criteria object. When removed, the variable will no longer be used to set the method or field when thecommitmethod is invoked.
-
iterator
public java.util.Iterator<java.lang.Object> iterator()
This is used to acquire an iterator over the named variables. Providing anIteratorallows the criteria to be used in a for each loop. This is primarily for convenience.- Specified by:
iteratorin 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 aVariableand 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.ExceptionThis 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.
-
-