|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.photoviewer.server.util.XMLStack
The com.photoviewer.server.XMLStack class is a utility class for writing XML files. It allows easy writing of element tags and attributes, and makes closing element tags easy.
Field Summary | |
static java.lang.String |
NewLine
|
Constructor Summary | |
XMLStack(java.io.PrintWriter writer)
Constructor associates this functionality with a particular printWriter. |
Method Summary | |
void |
closeTag()
Close off an element. |
void |
endOpenTag()
Call this method to close and element tag after writing attributes to the element. |
java.lang.String |
escapeString(java.lang.String s)
Replace XML unfriendly characters (ampersand, less than, greater than, quote, and apostrophe) with XML friendly escaped versions. |
void |
fullTag(java.lang.String tag)
Open a an element tag, like this |
java.io.PrintWriter |
getPrintWriter()
Return the PrintWriter being used for output by this class |
void |
noElemEndOpenTag()
Close of an element that has no sub-elements. |
void |
openTag(java.lang.String tag)
Begin an |
void |
setMultiline(boolean multiline)
Set whether to use the m_multiline style of display or single line. |
void |
setTabWidth(int width)
Set the tabwidth to use for indentation |
void |
simpleTagValue(java.lang.String tag,
java.lang.String value)
Creat and element all at once with the content value inside. |
void |
tabOver()
Indent the current tabbing level |
void |
writeAttribute(java.lang.String attribute,
java.lang.String value)
Add attributes to an open element tag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String NewLine
Constructor Detail |
public XMLStack(java.io.PrintWriter writer)
Method Detail |
public java.io.PrintWriter getPrintWriter()
public void setTabWidth(int width)
public void setMultiline(boolean multiline)
public void tabOver()
public void openTag(java.lang.String tag)
tag
- is the String name of the element.public void writeAttribute(java.lang.String attribute, java.lang.String value)
attribute
- is the name of the attribute.value
- is the value of the attribute, the portion in quotes.public void fullTag(java.lang.String tag)
tag
- is the name of the element tag.public void closeTag()
public void endOpenTag()
public void noElemEndOpenTag()
public void simpleTagValue(java.lang.String tag, java.lang.String value)
public java.lang.String escapeString(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |