net.sf.jsefa
Interface Deserializer

All Known Subinterfaces:
CsvDeserializer, FlrDeserializer, RbfDeserializer, XmlDeserializer
All Known Implementing Classes:
CsvDeserializerImpl, FlrDeserializerImpl, RbfDeserializerImpl, XmlDeserializerImpl

public interface Deserializer

Iterator-style interface for stream based deserializers.

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.
 

Method Detail

open

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

Parameters:
reader - the reader to base the stream on.
Throws:
DeserializationException

hasNext

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

Returns:
true, if another object can be deserialized from the stream, otherwise false.
Throws:
DeserializationException

next

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

Type Parameters:
T - the expected type of the object
Returns:
the deserialized object.
Throws:
DeserializationException

close

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

Parameters:
closeReader - if true, the underlying reader will be closed, too.
Throws:
DeserializationException

getInputPosition

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

Returns:
the input position or null if no position information is available


Copyright © 2014. All rights reserved.