Documentation of 'javolution37.javolution.xml.ObjectReader' Java class
ObjectReader
javolution37.javolution.xml

Class 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 XmlFormat of 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 CharacterData instances.

    • Constructor Summary

      Constructors 
      Constructor and Description
      ObjectReader()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      T read(java.nio.ByteBuffer byteBuffer)
      Creates an object from its XML representation read from the specified ByteBuffer.
      T read(java.io.InputStream in)
      Creates an object from its XML representation read from the specified InputStream.
      T read(java.io.Reader reader)
      Creates an object from its XML representation read from the specified Reader.
      void reset()
      Resets this object reader; objects previously read cannot be refered to, they will have to be send again.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectReader

        public ObjectReader()
        Default constructor.
    • Method Detail

      • read

        public T read(java.io.Reader reader)
               throws XmlException
        Creates an object from its XML representation read from the specified Reader. This method reads until the end of stream; to read multiple objects over a persistent connection XmlInputStream should 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 specified InputStream. This method reads until the end of stream; to read multiple objects over a persistent connection XmlInputStream should 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 specified ByteBuffer. 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.
      • reset

        public void reset()
        Resets this object reader; objects previously read cannot be refered to, they will have to be send again.
        Specified by:
        reset in interface Reusable

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.