|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.xml.util.XMLWriter
A class that makes it easy to write XML documents.
Field Summary | |
protected boolean |
closed
|
protected String |
defaultNameSpace
|
protected IndentPrintWriter |
writer
|
Constructor Summary | |
XMLWriter(Writer w)
|
|
XMLWriter(Writer w,
String indentString)
|
|
XMLWriter(Writer w,
String indentString,
String defaultNameSpace)
|
Method Summary | |
protected void |
checkNameValid(String s)
|
void |
close()
closes the writer |
void |
closeDoc()
Closes the document, and checks if you closed all the tags |
void |
closeTag()
Closes the current XML tag and decreases the indentation level |
static String |
normalize(String s)
Normalizes the given string for an Attribute value |
static String |
normalizeText(String s)
Normalizes the given string for Text |
void |
openDoc()
Opens the document with an xml header |
void |
openDoc(String version,
String encoding,
boolean standalone)
Opens the document with an xml header |
void |
openTag(String name)
Prints a new XML tag and increases the identation level |
void |
openTag(String namespace,
String name)
Prints a new XML tag and increases the identation level |
void |
print(Node node)
Prints a DOM node, recursively. |
void |
print(String text)
Prints character data, while escaping < and > |
protected void |
printAttributes(int tagLength)
|
void |
printComment(String comment)
Print a comment |
void |
println(String text)
Prints character data, while escaping < and > |
void |
printTag(String name)
Prints an empty XML tag. |
void |
printTag(String namespace,
String name)
Prints an empty XML tag. |
void |
referToDTD(String name,
String system)
Writes a reference to a DTD |
void |
referToDTD(String name,
String pid,
String ref)
Writes a reference to a DTD |
void |
setAttribute(String name,
boolean value)
|
void |
setAttribute(String name,
byte value)
|
void |
setAttribute(String name,
char value)
|
void |
setAttribute(String name,
double value)
|
void |
setAttribute(String name,
float value)
|
void |
setAttribute(String name,
int value)
|
void |
setAttribute(String name,
long value)
|
void |
setAttribute(String name,
short value)
|
void |
setAttribute(String name,
String value)
Sets an attribute which will be included in the next tag printed by openTag or printTag |
void |
setAttribute(String ns,
String name,
boolean value)
|
void |
setAttribute(String ns,
String name,
double value)
|
void |
setAttribute(String ns,
String name,
int value)
|
void |
setAttribute(String namespace,
String name,
String value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean closed
protected IndentPrintWriter writer
protected String defaultNameSpace
Constructor Detail |
public XMLWriter(Writer w, String indentString, String defaultNameSpace)
public XMLWriter(Writer w, String indentString)
public XMLWriter(Writer w)
Method Detail |
public void close() throws IOException
IOException
public void openDoc()
public void openDoc(String version, String encoding, boolean standalone)
public void referToDTD(String name, String pid, String ref)
public void referToDTD(String name, String system)
public void closeDoc()
public void printComment(String comment)
public void print(String text)
public void println(String text)
public void openTag(String namespace, String name)
public void openTag(String name)
public void closeTag()
public void printTag(String namespace, String name)
public void printTag(String name)
public void setAttribute(String name, String value)
public void setAttribute(String namespace, String name, String value)
public void setAttribute(String name, double value)
public void setAttribute(String name, float value)
public void setAttribute(String name, int value)
public void setAttribute(String name, long value)
public void setAttribute(String name, short value)
public void setAttribute(String name, boolean value)
public void setAttribute(String name, byte value)
public void setAttribute(String name, char value)
public void setAttribute(String ns, String name, double value)
public void setAttribute(String ns, String name, int value)
public void setAttribute(String ns, String name, boolean value)
protected void printAttributes(int tagLength)
public void print(Node node)
public static String normalize(String s)
public static String normalizeText(String s)
protected void checkNameValid(String s)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |