Modifier and Type | Method and Description |
---|---|
<T> T |
get(java.lang.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(java.lang.String name,
java.lang.Class<T> cls)
Returns the object of specified type only if the XML element has the
specified local name.
|
<T> T |
get(java.lang.String localName,
java.lang.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(java.lang.String localName,
java.lang.String uri,
java.lang.Class<T> cls)
Returns the object of specified type only if the
XML element has the specified local name and namespace URI.
|
CharArray |
getAttribute(java.lang.String name)
Searches for the attribute having the specified name.
|
boolean |
getAttribute(java.lang.String name,
boolean defaultValue)
Returns the specified
boolean attribute. |
byte |
getAttribute(java.lang.String name,
byte defaultValue)
Returns the specified
byte attribute. |
char |
getAttribute(java.lang.String name,
char defaultValue)
Returns the specified
char attribute. |
double |
getAttribute(java.lang.String name,
double defaultValue)
Returns the specified
double attribute. |
float |
getAttribute(java.lang.String name,
float defaultValue)
Returns the specified
float attribute. |
int |
getAttribute(java.lang.String name,
int defaultValue)
Returns the specified
int attribute. |
long |
getAttribute(java.lang.String name,
long defaultValue)
Returns the specified
long attribute. |
short |
getAttribute(java.lang.String name,
short defaultValue)
Returns the specified
short attribute. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Returns the specified
String attribute. |
<T> T |
getAttribute(java.lang.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.XMLStreamException
public <T> T getNext() throws XMLStreamException
null
.XMLStreamException
- if hasNext() == false
.public <T> T get(java.lang.String name) throws XMLStreamException
name
- the local name of the next element.null
.XMLStreamException
public <T> T get(java.lang.String localName, java.lang.String uri) throws XMLStreamException
localName
- the local name.uri
- the namespace URI or null
.null
.XMLStreamException
public <T> T get(java.lang.String name, java.lang.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
.XMLStreamException
public <T> T get(java.lang.String localName, java.lang.String uri, java.lang.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
.XMLStreamException
public CharArray getText() throws XMLStreamException
getStreamReader().getElementText()
).XMLStreamException
public Attributes getAttributes() throws XMLStreamException
XMLStreamException
public CharArray getAttribute(java.lang.String name) throws XMLStreamException
name
- the name of the attribute.null
if the attribute is not found.XMLStreamException
public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue) throws XMLStreamException
String
attribute.name
- the name of the attribute.defaultValue
- a default value.defaultValue
if the attribute is not found.XMLStreamException
public boolean getAttribute(java.lang.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.XMLStreamException
public char getAttribute(java.lang.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.XMLStreamException
public byte getAttribute(java.lang.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.XMLStreamException
public short getAttribute(java.lang.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.XMLStreamException
public int getAttribute(java.lang.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.XMLStreamException
public long getAttribute(java.lang.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.XMLStreamException
public float getAttribute(java.lang.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.XMLStreamException
public double getAttribute(java.lang.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.XMLStreamException
public <T> T getAttribute(java.lang.String name, T defaultValue) throws XMLStreamException
TextFormat
is
used to parse the attribute value.name
- the name of the attribute.defaultValue
- the value returned if the attribute is not found.XMLStreamException
Copyright © 2005 - 2007 Javolution.