de.smartics.maven.issues.cache
Class XmlTaskReader

Package class diagram package XmlTaskReader
java.lang.Object
  extended by de.smartics.maven.issues.cache.XmlTaskReader
All Implemented Interfaces:
Closeable

public class XmlTaskReader
     
     
extends Object
implements Closeable

Reads a task from a given stream.

Author:
Robert Reiner

Field Summary
protected  javax.xml.stream.XMLStreamReader xmlReader
          The reader to read single tasks from.
 
Constructor Summary
XmlTaskReader(javax.xml.stream.XMLStreamReader xmlReader)
          Default constructor.
 
Method Summary
 void close()
           The stream is closed quietly, logging any failure at error level.
 org.eclipse.mylyn.tasks.core.data.TaskData createTaskData()
          Creates the task data instance containing basic information required to be passed to the constructor.
 org.eclipse.mylyn.tasks.core.data.TaskData readTask()
          Reads the task from the given XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlReader

protected final javax.xml.stream.XMLStreamReader xmlReader
The reader to read single tasks from.

Constructor Detail

XmlTaskReader

public XmlTaskReader(javax.xml.stream.XMLStreamReader xmlReader)
              throws NullPointerException
Default constructor.

Parameters:
xmlReader - the reader to read single tasks from.
Throws:
NullPointerException - if the xmlWriter is null.
Method Detail

readTask

public org.eclipse.mylyn.tasks.core.data.TaskData readTask()
                                                    throws javax.xml.stream.XMLStreamException
Reads the task from the given XML stream.

Returns:
the task instance constructed from the information read from the given stream, null if no element is on the stream.
Throws:
javax.xml.stream.XMLStreamException - if the information cannot be read from the stream.

createTaskData

public org.eclipse.mylyn.tasks.core.data.TaskData createTaskData()
                                                          throws javax.xml.stream.XMLStreamException
Creates the task data instance containing basic information required to be passed to the constructor.

Returns:
the instantiated task data.
Throws:
javax.xml.stream.XMLStreamException - if the instance cannot be created due to reading problems or invalid information on the stream.

close

public void close()

The stream is closed quietly, logging any failure at error level.

Specified by:
close in interface Closeable
See Also:
Closeable.close()


Copyright © 2008-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.