net.sf.freecol.common.util
Class XMLStream
java.lang.Object
net.sf.freecol.common.util.XMLStream
- All Implemented Interfaces:
- java.io.Closeable
public class XMLStream
- extends java.lang.Object
- implements java.io.Closeable
A wrapper for XMLStreamReader and the underlying stream.
The close method on XMLStreamReader doesn't close
the underlying stream. This class is a wrapper for the
XMLStreamReader and the underlying stream with
a close() method which close them both.
|
Constructor Summary |
XMLStream(java.io.InputStream inputStream)
Creates a new XMLStream. |
|
Method Summary |
void |
close()
Closes both the XMLStreamReader and
the underlying stream. |
private javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.io.InputStream inputStream)
|
javax.xml.stream.XMLStreamReader |
getXMLStreamReader()
Get the XMLStreamReader. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final java.util.logging.Logger logger
inputStream
private java.io.InputStream inputStream
xmlStreamReader
private javax.xml.stream.XMLStreamReader xmlStreamReader
XMLStream
public XMLStream(java.io.InputStream inputStream)
throws java.io.IOException
- Creates a new
XMLStream.
- Parameters:
inputStream - The InputStream to create
a XMLStreamReader for.
- Throws:
java.io.IOException - if thrown while creating the
XMLStreamReader.
getXMLStreamReader
public javax.xml.stream.XMLStreamReader getXMLStreamReader()
- Get the
XMLStreamReader.
- Returns:
- The
XMLStreamReader created using
the underlying stream provided by the contructor
on this object.
close
public void close()
- Closes both the
XMLStreamReader and
the underlying stream.
- Specified by:
close in interface java.io.Closeable
createXMLStreamReader
private javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream inputStream)
throws java.io.IOException
- Throws:
java.io.IOException