Node Director
Public Member Functions | Static Public Member Functions | List of all members
sfi.director.util.XmlCreator Class Reference

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)

Detailed Description

create simple XML text documents.

Since we are using GCJ/classpath with broken SAXTransformer support we implement our own, simplified method.

Constructor & Destructor Documentation

sfi.director.util.XmlCreator.XmlCreator ( ) throws DirectorException

Member Function Documentation

void sfi.director.util.XmlCreator.addEncode ( char[]  ch,
int  start,
int  length 
)
void sfi.director.util.XmlCreator.addEncode ( char[]  ch)
void sfi.director.util.XmlCreator.addEncode ( String  st)
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 String sfi.director.util.XmlCreator.encode ( char[]  ch,
int  start,
int  length 
)
static
static String sfi.director.util.XmlCreator.encode ( String  text)
static
void sfi.director.util.XmlCreator.endElement ( String  localName)

end an element.

This is SAX-alike.

References sfi.director.util.XmlCreator.text().

void sfi.director.util.XmlCreator.setRaw ( String  newText)
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().


The documentation for this class was generated from the following file: