|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jtheque.core.utils.file.XMLReader
public final class XMLReader
A reader for XML files.
Constructor Summary | |
---|---|
XMLReader()
|
Method Summary | |
---|---|
void |
close()
|
org.jdom.Element |
getNode(java.lang.String path,
java.lang.Object node)
Return the unique node corresponding to the XPath request on the specified node. |
java.util.List<org.jdom.Element> |
getNodes(java.lang.String path,
java.lang.Object node)
Return all the nodes corresponding to the XPath request on the specified node. |
org.jdom.Element |
getRootElement()
Return the root element of the reader. |
void |
openFile(java.io.File file)
Open the file. |
void |
openFile(java.lang.String strFile)
Open the file. |
void |
openURL(java.lang.String strUrl)
Open the file a the URL. |
void |
openURL(java.net.URL url)
Open the file a the URL. |
boolean |
readBoolean(java.lang.String path,
java.lang.Object node)
Read a boolean value from the node. |
double |
readDouble(java.lang.String path,
java.lang.Object node)
Read a double value from the node. |
int |
readInt(java.lang.String path,
java.lang.Object node)
Read a int value from the node. |
long |
readLong(java.lang.String path,
java.lang.Object node)
Read a long value from the node. |
java.lang.String |
readString(java.lang.String path,
java.lang.Object node)
Read a String value from the node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLReader()
Method Detail |
---|
public void openURL(java.lang.String strUrl) throws XMLException
strUrl
- The URL of the XML file.
XMLException
- If an error occurs during the open process.public void openURL(java.net.URL url) throws XMLException
url
- The URL of the XML file.
XMLException
- If an error occurs during the open process.public void openFile(java.lang.String strFile) throws XMLException
strFile
- The path to the file to open.
XMLException
- If an error occurs during the open process.public void openFile(java.io.File file) throws XMLException
file
- The file to open.
XMLException
- If an error occurs during the open process.public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
public org.jdom.Element getRootElement()
public java.util.List<org.jdom.Element> getNodes(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node to request in.
XMLException
- If an errors occurs during the reading process.public org.jdom.Element getNode(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node to request in.
XMLException
- If an errors occurs during the reading process.public java.lang.String readString(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node.
XMLException
- If an errors occurs during the reading process.public int readInt(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node.
XMLException
- If an errors occurs during the reading process.public double readDouble(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node.
XMLException
- If an errors occurs during the reading process.public boolean readBoolean(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node.
XMLException
- If an errors occurs during the reading process.public long readLong(java.lang.String path, java.lang.Object node) throws XMLException
path
- The XPath request.node
- The node.
XMLException
- If an errors occurs during the reading process.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |