Package org.simpleframework.xml.core
Class Variable.Adapter
- java.lang.Object
-
- org.simpleframework.xml.core.Variable.Adapter
-
- Enclosing class:
- Variable
private static class Variable.Adapter extends java.lang.Object implements Repeater
TheAdapterobject is used to call the repeater with the original deserialized object. Using this object the converter interface can be used to perform repeat reads for the object. This must be given aRepeaterin order to invoke the repeat read method.
-
-
Field Summary
Fields Modifier and Type Field Description private LabellabelThis contains the details for the annotated field or method.private ConverterreaderThis is the converter object used to perform a repeat read.private java.lang.ObjectvalueThis is the originally deserialized object value to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectread(InputNode node)Thisreadmethod will perform a read using the provided object with the repeater.java.lang.Objectread(InputNode node, java.lang.Object value)Thisreadmethod will perform a read using the provided object with the repeater.booleanvalidate(InputNode node)Thisreadmethod will perform a read using the provided object with the repeater.voidwrite(OutputNode node, java.lang.Object value)Thiswritemethod acts like any other write in that it passes on the node and source object to write.
-
-
-
Field Detail
-
reader
private final Converter reader
This is the converter object used to perform a repeat read.
-
value
private final java.lang.Object value
This is the originally deserialized object value to use.
-
label
private final Label label
This contains the details for the annotated field or method.
-
-
Constructor Detail
-
Adapter
public Adapter(Converter reader, Label label, java.lang.Object value)
Constructor for theAdapterobject. This will create an adapter between the converter an repeater such that the reads will read from the XML to the original.- Parameters:
reader- this is the converter object to be usedvalue- this is the originally deserialized object
-
-
Method Detail
-
read
public java.lang.Object read(InputNode node) throws java.lang.Exception
Thisreadmethod will perform a read using the provided object with the repeater. Reading with this method ensures that any additional XML elements within the source will be added to the value.
-
read
public java.lang.Object read(InputNode node, java.lang.Object value) throws java.lang.Exception
Thisreadmethod will perform a read using the provided object with the repeater. Reading with this method ensures that any additional XML elements within the source will be added to the value.- Specified by:
readin interfaceConverter- Specified by:
readin interfaceRepeater- Parameters:
node- this is the node that contains the extra datavalue- this is the value to read the objects in to- Returns:
- this will return the original deserialized object
- Throws:
java.lang.Exception- if a deserialized type cannot be instantiated
-
validate
public boolean validate(InputNode node) throws java.lang.Exception
Thisreadmethod will perform a read using the provided object with the repeater. Reading with this method ensures that any additional XML elements within the source will be added to the value.
-
write
public void write(OutputNode node, java.lang.Object value) throws java.lang.Exception
Thiswritemethod acts like any other write in that it passes on the node and source object to write. Typically this will not be used as the repeater object is used for repeat reads of scattered XML elements.
-
-