net.sf.jsefa.xml.lowlevel
Class XmlPullBasedXmlLowLevelDeserializer

java.lang.Object
  extended by net.sf.jsefa.xml.lowlevel.XmlPullBasedXmlLowLevelDeserializer
All Implemented Interfaces:
LowLevelDeserializer, XmlLowLevelDeserializer

public final class XmlPullBasedXmlLowLevelDeserializer
extends Object
implements XmlLowLevelDeserializer

XmlPull V1 based implementation of XmlLowLevelDeserializer. Suitable for the Android platform.

Author:
Sebastian Hoß, Norman Lahme-Huetig

Constructor Summary
XmlPullBasedXmlLowLevelDeserializer(XmlLowLevelConfiguration config)
          Constructs a new StaxBasedXmlLowLevelDeserializer.
 
Method Summary
 void close(boolean closeReader)
          Closes the deserialization stream.
 XmlItem current()
          Returns the current xml item.
 int currentDepth()
          Returns the current element depth.
 XmlItemType currentType()
          Returns the type of the current xml item.
 InputPosition getInputPosition()
          Returns information about the current position within the input stream.
 boolean hasNext()
          Returns true if another xml item can be deserialized from the stream.
 void moveToNext()
          Moves to the next xml item which can be deserialized.
 void open(Reader reader)
          Opens a new deserialization stream based on the given reader.
 void open(Reader reader, String systemId)
          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
 

Constructor Detail

XmlPullBasedXmlLowLevelDeserializer

public XmlPullBasedXmlLowLevelDeserializer(XmlLowLevelConfiguration config)
Constructs a new StaxBasedXmlLowLevelDeserializer.

Parameters:
config - the configuration object
Method Detail

open

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

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

open

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

Specified by:
open in interface XmlLowLevelDeserializer
Parameters:
reader - the reader to base the stream on.
systemId - 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 xml item can be deserialized from the stream.

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

moveToNext

public void moveToNext()
Moves to the next xml item which can be deserialized.

Specified by:
moveToNext in interface XmlLowLevelDeserializer

currentType

public XmlItemType currentType()
Returns the type of the current xml item. See XmlItemType for the different values allowed.

Specified by:
currentType in interface XmlLowLevelDeserializer
Returns:
the type of the current xml item.

current

public XmlItem current()
Returns the current xml item.

Specified by:
current in interface XmlLowLevelDeserializer
Returns:
the current xml item.

currentDepth

public int currentDepth()
Returns the current element depth.

The depth of the root element is 0.

Specified by:
currentDepth in interface XmlLowLevelDeserializer
Returns:
the current depth.

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 LowLevelDeserializer
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 LowLevelDeserializer
Returns:
the input position or null if no position information is available


Copyright © 2014. All rights reserved.