javolution37.javolution.xml
Class ObjectReader<T>
- java.lang.Object
-
- javolution37.javolution.xml.ObjectReader<T>
-
- All Implemented Interfaces:
- Reusable
public class ObjectReader<T> extends java.lang.Object implements Reusable
This class restores objects which have been serialized in XML format using an
ObjectWriter.When the XML document is parsed, each elements are recursively processed and Java objects are created using the
XmlFormatof the class identified by the name of the XML element. The final object constructed (and returned) is always the root element of the XML input source.Non-blank character data of the XML document are represented by
CharacterDatainstances.
-
-
Constructor Summary
Constructors Constructor and Description ObjectReader()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Tread(java.nio.ByteBuffer byteBuffer)Creates an object from its XML representation read from the specifiedByteBuffer.Tread(java.io.InputStream in)Creates an object from its XML representation read from the specifiedInputStream.Tread(java.io.Reader reader)Creates an object from its XML representation read from the specifiedReader.voidreset()Resets this object reader; objects previously read cannot be refered to, they will have to be send again.
-
-
-
Method Detail
-
read
public T read(java.io.Reader reader) throws XmlException
Creates an object from its XML representation read from the specifiedReader. This method reads until the end of stream; to read multiple objects over a persistent connectionXmlInputStreamshould be used instead.- Parameters:
reader- the reader containing the XML representation of the object being created.- Returns:
- the object corresponding to the xml root element.
- Throws:
XmlException- if the object cannot be created.
-
read
public T read(java.io.InputStream in) throws XmlException
Creates an object from its XML representation read from the specifiedInputStream. This method reads until the end of stream; to read multiple objects over a persistent connectionXmlInputStreamshould be used instead.- Parameters:
in- the input stream containing the XML representation of the object being created.- Returns:
- the object corresponding to the xml root element.
- Throws:
XmlException- if the object cannot be created.
-
read
public T read(java.nio.ByteBuffer byteBuffer) throws XmlException
Creates an object from its XML representation read from the specifiedByteBuffer. This method reads from the current buffer position up to the buffer's limit.- Parameters:
byteBuffer- the byte buffer containing the XML representation of the object being created.- Returns:
- the object corresponding to the xml root element.
- Throws:
XmlException- if the object cannot be created.
-
-
DMelt 3.0 © DataMelt by jWork.ORG