Constructor and Description |
---|
Xml() |
Modifier and Type | Method and Description |
---|---|
static void |
attribute(String name,
boolean value)
Add a boolean-valued attribute to an open XML tag.
|
static void |
attribute(String name,
byte[] value)
Add a byte[]-valued attribute to an open XML tag.
|
static void |
attribute(String name,
double value)
Add a double-valued attribute to an open XML tag.
|
static void |
attribute(String name,
int value)
Add an int-valued attribute to an open XML tag.
|
static void |
attribute(String name,
long value)
Add a long-valued attribute to an open XML tag.
|
static void |
attribute(String name,
String value)
Add a String-valued attribute to an open XML tag.
|
static void |
attribute(String name,
Word value)
Add a word-valued attribute to an open XML tag.
|
static void |
begin()
Mark the start of XML output
|
static void |
closeAttribute()
Close an attribute (actually a simple close-quote)
|
static void |
closeComment()
Close an XML comment
|
static void |
closeMinorTag()
Close a tag with a "/>"
|
static void |
closeTag(boolean close)
End a tag, optionally closing it (if it is a simple entity)
|
static void |
closeTag(boolean close,
boolean endLine)
End a tag, optionally closing it (if it is a simple entity),
and optionally printing end-of-line
|
static void |
closeTag(String name)
Closes the innermost XML tag and pops it from the stack.
|
static void |
comment(String comment)
Add a comment, bracketing it with open- and close-comment tags.
|
static void |
configItem(String name,
boolean value)
Output a "config" entity, with a given name and
boolean value. |
static void |
configItem(String name,
String value)
Output a "config" entity, with a given name and
String value. |
static void |
end()
Mark the end of XML output
|
static void |
openAttribute(String name)
Open an attribute (write "{name}=\")
|
static void |
openComment()
Open an XML comment
|
static void |
openMinorTag(String name)
Open a tag without pushing it on the tag stack - must end this
with a call to closeMinorTag()
|
(package private) static void |
openTag(String name)
Open a simple XML entity.
|
(package private) static void |
openTag(String name,
boolean endTag)
Open an XML tag.
|
static void |
singleValue(String name,
double value)
Convenience version of singleValue where units are not specified.
|
static void |
singleValue(String name,
double value,
String units)
Output a "stat" entity, with a given name,
double value and optionally, units. |
static void |
singleValue(String name,
long value)
Convenience version of singleValue where units are not specified.
|
static void |
singleValue(String name,
long value,
String units)
Output a "stat" entity, with a given name,
long value and
optionally, units. |
static void |
startTag()
Start a tag
|
public Xml()
public static void begin()
public static void end()
public static void closeTag(String name)
name
- the tag's namestatic void openTag(String name, boolean endTag)
name
- Tag nameendTag
- Should the tag be closed, or left open for
adding additional attributesstatic void openTag(String name)
name
- Name of the entitypublic static void singleValue(String name, double value, String units)
double
value and optionally, units.name
- Name of the entityvalue
- The value of the entityunits
- The units, or null for no units.public static void singleValue(String name, double value)
name
- Name of the entityvalue
- The value of the entitypublic static void configItem(String name, boolean value)
boolean
value.name
- Name of the entityvalue
- The value of the entitypublic static void configItem(String name, String value)
String
value.name
- Name of the entityvalue
- The value of the entitypublic static void singleValue(String name, long value, String units)
long
value and
optionally, units.name
- Name of the entityvalue
- The value of the entityunits
- The units, or null for no units.public static void singleValue(String name, long value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, Word value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, byte[] value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, String value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, boolean value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, double value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, long value)
name
- Name of the entityvalue
- The value of the entitypublic static void attribute(String name, int value)
name
- Name of the entityvalue
- The value of the entitypublic static void closeAttribute()
public static void openAttribute(String name)
name
- Name of the entitypublic static void startTag()
public static void closeTag(boolean close)
close
- If true, close the tag with "/>" rather than ">"public static void closeTag(boolean close, boolean endLine)
close
- If true, close the tag with "/>" rather than ">"endLine
- If true end the current line.public static void closeMinorTag()
public static void openMinorTag(String name)
name
- Name of the entitypublic static void openComment()
public static void closeComment()