|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwalker.ExtendedXMLStreamReader
public class ExtendedXMLStreamReader
Created by IntelliJ IDEA. User: andy Date: Mar 24, 2010 Extends XMLStreamReader with basic helper functions for parsing a wiseml with Stax.
Constructor Summary | |
---|---|
ExtendedXMLStreamReader(java.io.InputStream is)
Default Constructor. |
Method Summary | |
---|---|
java.lang.String |
attr(java.lang.String attr)
Parses a single attribute of the current element. |
protected Capability |
capability()
Reads a single capability. |
boolean |
check(java.lang.String expect)
Make sure that the current element is the one that is expected. |
void |
close()
|
void |
debug()
|
java.lang.String |
elementText()
Parses the Text of the current wiseml element. |
java.lang.String |
getLocation()
Returns the current Location of the XMLStreamReader |
javax.xml.stream.XMLStreamReader |
getReader()
|
void |
navigate(java.lang.String expectedElement)
Navigates to an expected element in the stream. |
java.lang.String |
navigateRead(java.lang.String expectedElement)
Navigates to an expected element and reads its text. |
void |
nextElement()
Safely navigates to the next element in the stream. |
void |
nextStaxElement()
Navigates to the next Stax element. |
protected Position |
position()
Reads a single position element. |
protected Rssi |
rssi()
Reads a single Rssi object. |
java.lang.String |
text()
Fail Safe retrieval of text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtendedXMLStreamReader(java.io.InputStream is) throws javax.xml.stream.XMLStreamException
is
- the xml InputStream
javax.xml.stream.XMLStreamException
- if there is an xml syntaxMethod Detail |
---|
public java.lang.String attr(java.lang.String attr)
attr
- the name of the attribute.
protected Capability capability() throws badSyntaxException, javax.xml.stream.XMLStreamException
badSyntaxException
- is thrown if the element values don't have the expected format.
javax.xml.stream.XMLStreamException
- is thrown if there is a problem with xml syntax.public boolean check(java.lang.String expect)
expect
- the expected element name.
public void close() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void debug()
public java.lang.String elementText() throws javax.xml.stream.XMLStreamException, badSyntaxException, endDocumentException
javax.xml.stream.XMLStreamException
- is thrown if there is a problem with xml syntax.
badSyntaxException
- is thrown if there is no text.
endDocumentException
- if the root element is closed.public java.lang.String getLocation()
public javax.xml.stream.XMLStreamReader getReader()
public void navigate(java.lang.String expectedElement) throws javax.xml.stream.XMLStreamException, badSyntaxException, endDocumentException
expectedElement
- provide the name of the element to navigate to.
javax.xml.stream.XMLStreamException
- is thrown if there is no other element.
badSyntaxException
- is thrown if after 200 elements no match is found.
endDocumentException
- if the root element is closed.public java.lang.String navigateRead(java.lang.String expectedElement) throws javax.xml.stream.XMLStreamException, badSyntaxException, endDocumentException
expectedElement
- provide the name of the element to navigate to.
javax.xml.stream.XMLStreamException
- is thrown if there is a problem with xml syntax.
badSyntaxException
- is thrown if after 20 elements no match is found.
endDocumentException
- if the root element is closed.public void nextElement() throws javax.xml.stream.XMLStreamException, endDocumentException
javax.xml.stream.XMLStreamException
- is thrown if there is no other element.
endDocumentException
- if the root element is closed.public void nextStaxElement() throws javax.xml.stream.XMLStreamException, endDocumentException
Stax elements are:
javax.xml.stream.XMLStreamException
- is thrown if there is no other element.
endDocumentException
- if the root element is closed.protected Position position() throws badSyntaxException, javax.xml.stream.XMLStreamException
badSyntaxException
- throwed if a required element is missing or if a text doesn't match the expected type
javax.xml.stream.XMLStreamException
- is thrown if there is a problem with xml syntax.protected Rssi rssi() throws badSyntaxException
badSyntaxException
- is thrown if the element values don't have the expected format.public java.lang.String text() throws badSyntaxException
badSyntaxException
- if no text is found.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |