| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String name)
Returns the object whose type is identified by a XML class attribute
only if the XML element has the specified local name.
|
<T> T |
get(String name,
Class<T> cls)
Returns the object of specified type only if the XML element has the
specified local name.
|
<T> T |
get(String localName,
String uri)
Returns the object whose type is identified by a XML class attribute
only if the XML element has the specified local name and URI.
|
<T> T |
get(String localName,
String uri,
Class<T> cls)
Returns the object of specified type only if the
XML element has the specified local name and namespace URI.
|
CharArray |
getAttribute(String name)
Searches for the attribute having the specified name.
|
boolean |
getAttribute(String name,
boolean defaultValue)
Returns the specified
boolean attribute. |
byte |
getAttribute(String name,
byte defaultValue)
Returns the specified
byte attribute. |
char |
getAttribute(String name,
char defaultValue)
Returns the specified
char attribute. |
double |
getAttribute(String name,
double defaultValue)
Returns the specified
double attribute. |
float |
getAttribute(String name,
float defaultValue)
Returns the specified
float attribute. |
int |
getAttribute(String name,
int defaultValue)
Returns the specified
int attribute. |
long |
getAttribute(String name,
long defaultValue)
Returns the specified
long attribute. |
short |
getAttribute(String name,
short defaultValue)
Returns the specified
short attribute. |
String |
getAttribute(String name,
String defaultValue)
Returns the specified
String attribute. |
<T> T |
getAttribute(String name,
T defaultValue)
Returns the attribute of same type as the specified
default value.
|
Attributes |
getAttributes()
Returns the attributes for this XML input element.
|
<T> T |
getNext()
Returns the next object whose type is identified by the local name
and URI of the current XML element.
|
XMLStreamReader |
getStreamReader()
Returns the StAX-like stream reader (provides complete control
over the unmarshalling process).
|
CharArray |
getText()
Returns the content of a text-only element (equivalent to
getStreamReader().getElementText()). |
boolean |
hasNext()
Indicates if more nested XML element can be read.
|
public XMLStreamReader getStreamReader()
public boolean hasNext()
throws XMLStreamException
reader at the start of the
next XML element to be read (if any).true if there is more XML element to be read;
false otherwise.XMLStreamExceptionpublic <T> T getNext()
throws XMLStreamException
null.XMLStreamException - if hasNext() == false.public <T> T get(String name) throws XMLStreamException
name - the local name of the next element.null.XMLStreamExceptionpublic <T> T get(String localName, String uri) throws XMLStreamException
localName - the local name.uri - the namespace URI or null.null.XMLStreamExceptionpublic <T> T get(String name, Class<T> cls) throws XMLStreamException
name - the local name of the element to match.cls - the class identifying the format of the object to return.null.XMLStreamExceptionpublic <T> T get(String localName, String uri, Class<T> cls) throws XMLStreamException
localName - the local name.uri - the namespace URI or null.cls - the class identifying the format of the object to return.null.XMLStreamExceptionpublic CharArray getText() throws XMLStreamException
getStreamReader().getElementText()).XMLStreamExceptionpublic Attributes getAttributes() throws XMLStreamException
XMLStreamExceptionpublic CharArray getAttribute(String name) throws XMLStreamException
name - the name of the attribute.null
if the attribute is not found.XMLStreamExceptionpublic String getAttribute(String name, String defaultValue) throws XMLStreamException
String attribute.name - the name of the attribute.defaultValue - a default value.defaultValue if the attribute is not found.XMLStreamExceptionpublic boolean getAttribute(String name, boolean defaultValue) throws XMLStreamException
boolean attribute.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.boolean value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic char getAttribute(String name, char defaultValue) throws XMLStreamException
char attribute.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.char value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic byte getAttribute(String name, byte defaultValue) throws XMLStreamException
byte attribute. This method handles
string formats that are used to represent octal and hexadecimal numbers.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.byte value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic short getAttribute(String name, short defaultValue) throws XMLStreamException
short attribute. This method handles
string formats that are used to represent octal and hexadecimal numbers.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.short value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic int getAttribute(String name, int defaultValue) throws XMLStreamException
int attribute. This method handles
string formats that are used to represent octal and hexadecimal numbers.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.int value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic long getAttribute(String name, long defaultValue) throws XMLStreamException
long attribute. This method handles
string formats that are used to represent octal and hexadecimal numbers.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.long value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic float getAttribute(String name, float defaultValue) throws XMLStreamException
float attribute.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.float value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic double getAttribute(String name, double defaultValue) throws XMLStreamException
double attribute.name - the name of the attribute searched for.defaultValue - the value returned if the attribute is not found.double value for the specified attribute or
the default value if the attribute is not found.XMLStreamExceptionpublic <T> T getAttribute(String name, T defaultValue) throws XMLStreamException
name - the name of the attribute.defaultValue - the value returned if the attribute is not found.XMLStreamExceptionCopyright © 2005-2013 Javolution. All Rights Reserved.