| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object obj)
Adds the specified object or
null as an anonymous
nested element of unknown type. |
void |
add(java.lang.Object obj,
java.lang.String name)
Adds the specified object as a named nested element of unknown type
(
null objects are ignored). |
void |
add(java.lang.Object obj,
java.lang.String localName,
java.lang.String uri)
Adds the specified object as a fully qualified nested element of
unknown type (
null objects are ignored). |
<T> void |
add(T obj,
java.lang.String name,
java.lang.Class<T> cls)
Adds the specified object as a named nested element of specified
actual type (
null objects are ignored). |
<T> void |
add(T obj,
java.lang.String localName,
java.lang.String uri,
java.lang.Class<T> cls)
Adds the specified object as a fully qualified nested element of
specified actual type (
null objects are ignored). |
void |
addText(java.lang.CharSequence text)
Adds the content of a text-only element (equivalent to
getStreamWriter().writeCharacters(text)). |
void |
addText(java.lang.String text)
Equivalent to
addText(CharSequence)
(for J2ME compatibility). |
XMLStreamWriter |
getStreamWriter()
Returns the StAX-like stream writer (provides complete control over
the marshalling process).
|
void |
setAttribute(java.lang.String name,
boolean value)
Sets the specified
boolean attribute. |
void |
setAttribute(java.lang.String name,
byte value)
Sets the specified
byte attribute. |
void |
setAttribute(java.lang.String name,
char value)
Sets the specified
char attribute. |
void |
setAttribute(java.lang.String name,
java.lang.CharSequence value)
Sets the specified
CharSequence attribute
(null values are ignored). |
void |
setAttribute(java.lang.String name,
double value)
Sets the specified
double attribute. |
void |
setAttribute(java.lang.String name,
float value)
Sets the specified
float attribute. |
void |
setAttribute(java.lang.String name,
int value)
Sets the specified
int attribute. |
void |
setAttribute(java.lang.String name,
long value)
Sets the specified
long attribute. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the specified attribute using its associated
TextFormat. |
void |
setAttribute(java.lang.String name,
short value)
Sets the specified
short attribute. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets the specified
String attribute
(null values are ignored). |
public XMLStreamWriter getStreamWriter()
public void add(java.lang.Object obj)
throws XMLStreamException
null as an anonymous
nested element of unknown type.obj - the object added as nested element or null.XMLStreamExceptionpublic void add(java.lang.Object obj,
java.lang.String name)
throws XMLStreamException
null objects are ignored).
The nested XML element contains a class attribute identifying
the object type.obj - the object added as nested element or null.name - the name of the nested element.XMLStreamExceptionpublic void add(java.lang.Object obj,
java.lang.String localName,
java.lang.String uri)
throws XMLStreamException
null objects are ignored).
The nested XML element contains a class attribute identifying
the object type.obj - the object added as nested element or null.localName - the local name of the nested element.uri - the namespace URI of the nested element.XMLStreamExceptionpublic <T> void add(T obj,
java.lang.String name,
java.lang.Class<T> cls)
throws XMLStreamException
null objects are ignored).
The nested XML element does not contain any class attribute.obj - the object added as nested element or null.name - the name of the nested element.cls - the class identifying the format of the specified object.XMLStreamExceptionpublic <T> void add(T obj,
java.lang.String localName,
java.lang.String uri,
java.lang.Class<T> cls)
throws XMLStreamException
null objects are ignored).
The nested XML element does not contain any class attribute.obj - the object added as nested element or null.localName - the local name of the nested element.uri - the namespace URI of the nested element.cls - the class identifying the format of the specified object.XMLStreamExceptionpublic void addText(java.lang.CharSequence text)
throws XMLStreamException
getStreamWriter().writeCharacters(text)).text - the element text content or an empty sequence if none.XMLStreamExceptionpublic void addText(java.lang.String text)
throws XMLStreamException
addText(CharSequence)
(for J2ME compatibility).text - the element text content or an empty sequence if none.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
java.lang.CharSequence value)
throws XMLStreamException
CharSequence attribute
(null values are ignored).name - the attribute name.value - the attribute value or null.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
java.lang.String value)
throws XMLStreamException
String attribute
(null values are ignored).name - the attribute name.value - the attribute value.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
boolean value)
throws XMLStreamException
boolean attribute.name - the attribute name.value - the boolean value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
char value)
throws XMLStreamException
char attribute.name - the attribute name.value - the char value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
byte value)
throws XMLStreamException
byte attribute.name - the attribute name.value - the byte value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
short value)
throws XMLStreamException
short attribute.name - the attribute name.value - the short value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
int value)
throws XMLStreamException
int attribute.name - the attribute name.value - the int value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
long value)
throws XMLStreamException
long attribute.name - the attribute name.value - the long value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
float value)
throws XMLStreamException
float attribute.name - the attribute name.value - the float value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
double value)
throws XMLStreamException
double attribute.name - the attribute name.value - the double value for the specified attribute.XMLStreamExceptionpublic void setAttribute(java.lang.String name,
java.lang.Object value)
throws XMLStreamException
TextFormat.name - the name of the attribute.value - the Boolean value for the specified attribute
or null in which case the attribute is not set.XMLStreamExceptionCopyright © 2005 - 2007 Javolution.