public abstract class XMLGenerator
extends Object
Modifier and Type | Field and Description |
---|---|
static String |
eol
The result of
System.getProperty( "line.separator" ) |
static String |
tab
Helpful in indentation; currently set to two spaces
|
Constructor and Description |
---|
XMLGenerator() |
Modifier and Type | Method and Description |
---|---|
static String |
endTag(String tag)
Returns a simple end tag of the form
</tag> |
static String |
quoteForXML(String unquoted)
Converts certain characters into their XML quoted versions; e.g.,
"<" becomes
"<" . |
static String |
simpleTaggedString(String tag,
String value)
Rewrite its arguments for XML.
|
static String |
simpleTaggedString(String tag,
String value,
String parameters)
Rewrite its arguments for XML.
|
static String |
startTag(String tag)
Returns a simple tag.
|
static String |
startTag(String tag,
String parameters)
Returns a simple tag with parameters, without any closing tag.
|
static String |
tagWithParms(String tag,
String parameters)
Returns a tag with parameters, including a closing bracket.
|
static String |
XMLHeader() |
public static String eol
System.getProperty( "line.separator" )
public static String tab
public static String XMLHeader()
<?xml version=\"1.0\"?>
public static String simpleTaggedString(String tag, String value, String parameters)
tag
- value
- free text to be inserted between start and end tags.parameters
- a string of the form ... name1="value1" name2="value2"
...
<tag name1="value1" name2="value2" > freetext </tag>
public static String simpleTaggedString(String tag, String value)
tag
- value
- free text to be inserted between start and end tags.<tag> freetext </tag>
public static String startTag(String tag)
<tag>
public static String startTag(String tag, String parameters)
<tag name1="value1" name2="value2">
public static String tagWithParms(String tag, String parameters)
<tag name1="value1" name2="value2"/>
public static String endTag(String tag)
</tag>
public static String quoteForXML(String unquoted)
"<"
becomes
"<"
. Currently the following are converted: Character | Reference |
& | & |
< | < |
> | > |
" | " |
' | ' |