net.sf.jsefa.xml
Class XmlDeserializerImpl

java.lang.Object
  extended by net.sf.jsefa.xml.XmlDeserializerImpl
All Implemented Interfaces:
Deserializer, XmlDeserializer

public final class XmlDeserializerImpl
extends Object
implements XmlDeserializer

Default implementation of XmlDeserializer.

Author:
Norman Lahme-Huetig

Method Summary
 void close(boolean closeReader)
          Closes the deserialization stream.
 InputPosition getInputPosition()
          Returns information about the current position within the input stream.
 boolean hasNext()
          Returns true if another object can be deserialized from the stream.
<T> T
next()
          Deserializes an object from the stream.
 void open(Reader reader)
          Opens a new deserialization stream based on the given reader.
 void open(Reader reader, String baseURI)
          Opens a new deserialization stream based on the given reader and system id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

open

public void open(Reader reader)
Opens a new deserialization stream based on the given reader.

Specified by:
open in interface Deserializer
Parameters:
reader - the reader to base the stream on.

open

public void open(Reader reader,
                 String baseURI)
Opens a new deserialization stream based on the given reader and system id.

Specified by:
open in interface XmlDeserializer
Parameters:
reader - the reader to base the stream on.
baseURI - the system ID of the stream as an URI string. Will be used to resolve relative URIs.

hasNext

public boolean hasNext()
Returns true if another object can be deserialized from the stream.

Specified by:
hasNext in interface Deserializer
Returns:
true, if another object can be deserialized from the stream, otherwise false.

next

public <T> T next()
Deserializes an object from the stream.

Specified by:
next in interface Deserializer
Type Parameters:
T - the expected type of the object
Returns:
the deserialized object.

close

public void close(boolean closeReader)
Closes the deserialization stream. The underlying reader will be closed only if closeReader is true.

Specified by:
close in interface Deserializer
Parameters:
closeReader - if true, the underlying reader will be closed, too.

getInputPosition

public InputPosition getInputPosition()
Returns information about the current position within the input stream.

Specified by:
getInputPosition in interface Deserializer
Returns:
the input position or null if no position information is available


Copyright © 2014. All rights reserved.