Modifier and Type | Method and Description |
---|---|
void |
add(Object obj)
Adds the specified object or
null as an anonymous
nested element of unknown type. |
void |
add(Object obj,
String name)
Adds the specified object as a named nested element of unknown type
(
null objects are ignored). |
void |
add(Object obj,
String name,
Class cls)
Adds the specified object as a named nested element of specified
actual type (
null objects are ignored). |
void |
add(Object obj,
String localName,
String uri)
Adds the specified object as a fully qualified nested element of
unknown type (
null objects are ignored). |
void |
add(Object obj,
String localName,
String uri,
Class cls)
Adds the specified object as a fully qualified nested element of
specified actual type (
null objects are ignored). |
void |
addText(CharSequence text)
Adds the content of a text-only element (equivalent to
getStreamWriter().writeCharacters(text) ). |
void |
addText(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(String name,
boolean value)
Sets the specified
boolean attribute. |
void |
setAttribute(String name,
byte value)
Sets the specified
byte attribute. |
void |
setAttribute(String name,
char value)
Sets the specified
char attribute. |
void |
setAttribute(String name,
CharSequence value)
Sets the specified
CharSequence attribute
(null values are ignored). |
void |
setAttribute(String name,
double value)
Sets the specified
double attribute. |
void |
setAttribute(String name,
float value)
Sets the specified
float attribute. |
void |
setAttribute(String name,
int value)
Sets the specified
int attribute. |
void |
setAttribute(String name,
long value)
Sets the specified
long attribute. |
void |
setAttribute(String name,
Object value)
Sets the specified attribute using its associated
TextFormat . |
void |
setAttribute(String name,
short value)
Sets the specified
short attribute. |
void |
setAttribute(String name,
String value)
Sets the specified
String attribute
(null values are ignored). |
public XMLStreamWriter getStreamWriter()
public void add(Object obj) throws XMLStreamException
null
as an anonymous
nested element of unknown type.obj
- the object added as nested element or null
.XMLStreamException
public void add(Object obj, 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.XMLStreamException
public void add(Object obj, String localName, 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.XMLStreamException
public void add(Object obj, String name, Class 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.XMLStreamException
public void add(Object obj, String localName, String uri, Class 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.XMLStreamException
public void addText(CharSequence text) throws XMLStreamException
getStreamWriter().writeCharacters(text)
).text
- the element text content or an empty sequence if none.XMLStreamException
public void addText(String text) throws XMLStreamException
addText(CharSequence)
(for J2ME compatibility).text
- the element text content or an empty sequence if none.XMLStreamException
public void setAttribute(String name, CharSequence value) throws XMLStreamException
CharSequence
attribute
(null
values are ignored).name
- the attribute name.value
- the attribute value or null
.XMLStreamException
public void setAttribute(String name, String value) throws XMLStreamException
String
attribute
(null
values are ignored).name
- the attribute name.value
- the attribute value.XMLStreamException
public void setAttribute(String name, boolean value) throws XMLStreamException
boolean
attribute.name
- the attribute name.value
- the boolean
value for the specified attribute.XMLStreamException
public void setAttribute(String name, char value) throws XMLStreamException
char
attribute.name
- the attribute name.value
- the char
value for the specified attribute.XMLStreamException
public void setAttribute(String name, byte value) throws XMLStreamException
byte
attribute.name
- the attribute name.value
- the byte
value for the specified attribute.XMLStreamException
public void setAttribute(String name, short value) throws XMLStreamException
short
attribute.name
- the attribute name.value
- the short
value for the specified attribute.XMLStreamException
public void setAttribute(String name, int value) throws XMLStreamException
int
attribute.name
- the attribute name.value
- the int
value for the specified attribute.XMLStreamException
public void setAttribute(String name, long value) throws XMLStreamException
long
attribute.name
- the attribute name.value
- the long
value for the specified attribute.XMLStreamException
public void setAttribute(String name, float value) throws XMLStreamException
float
attribute.name
- the attribute name.value
- the float
value for the specified attribute.XMLStreamException
public void setAttribute(String name, double value) throws XMLStreamException
double
attribute.name
- the attribute name.value
- the double
value for the specified attribute.XMLStreamException
public void setAttribute(String name, 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.XMLStreamException
Copyright © 2005–2018 Javolution. All rights reserved.