Node Director
|
create simple XML text documents. More...
Public Member Functions | |
XmlCreator () throws DirectorException | |
void | startElement (String localName, Attributes atts) |
start an element. | |
void | endElement (String localName) |
end an element. | |
void | characters (char[] ch, int start, int length) |
add element contents. | |
void | addEncode (char[] ch, int start, int length) |
add text. | |
void | addEncode (char[] ch) |
add text. | |
void | addEncode (String st) |
add text. | |
void | addRaw (String st) |
add raw text. | |
String | text () |
get the text representation of the current document. | |
void | setRaw (String newText) |
Static Public Member Functions | |
static String | encode (char[] ch, int start, int length) |
static String | encode (String text) |
create simple XML text documents.
Since we are using GCJ/classpath with broken SAXTransformer support we implement our own, simplified method.
sfi.director.util.XmlCreator.XmlCreator | ( | ) | throws DirectorException |
void sfi.director.util.XmlCreator.addEncode | ( | char[] | ch, |
int | start, | ||
int | length | ||
) |
add text.
The text is minimally encoded, thus <, > and " characters are translated.
References sfi.director.util.XmlCreator.encode(), and sfi.director.util.XmlCreator.text().
Referenced by sfi.director.util.XmlCreator.addEncode(), sfi.director.util.XmlCreator.characters(), and sfi.director.util.XmlCreator.startElement().
void sfi.director.util.XmlCreator.addEncode | ( | char[] | ch | ) |
add text.
References sfi.director.util.XmlCreator.addEncode().
void sfi.director.util.XmlCreator.addEncode | ( | String | st | ) |
add text.
References sfi.director.util.XmlCreator.addEncode().
void sfi.director.util.XmlCreator.addRaw | ( | String | st | ) |
add raw text.
The text is appended as is, thus may contain XML tags. The caller is responsible for ensuring correct encoding of special characters.
References sfi.director.util.XmlCreator.text().
void sfi.director.util.XmlCreator.characters | ( | char[] | ch, |
int | start, | ||
int | length | ||
) |
add element contents.
References sfi.director.util.XmlCreator.addEncode().
|
static |
|
static |
References sfi.director.util.XmlCreator.encode().
void sfi.director.util.XmlCreator.endElement | ( | String | localName | ) |
void sfi.director.util.XmlCreator.setRaw | ( | String | newText | ) |
References sfi.director.util.XmlCreator.text().
void sfi.director.util.XmlCreator.startElement | ( | String | localName, |
Attributes | atts | ||
) |
start an element.
This is SAX-alike, though only the localName and attributes are currently used.
References sfi.director.util.XmlCreator.addEncode(), and sfi.director.util.XmlCreator.text().
String sfi.director.util.XmlCreator.text | ( | ) |
get the text representation of the current document.
The text contains exactly the elements and text that was added. No automatic addition of XML headers and such are made.
Referenced by sfi.director.util.XmlCreator.addEncode(), sfi.director.util.XmlCreator.addRaw(), sfi.director.util.XmlCreator.encode(), sfi.director.util.XmlCreator.endElement(), sfi.director.util.XmlCreator.setRaw(), and sfi.director.util.XmlCreator.startElement().