|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.tools.cm.XMLWriter
public class XMLWriter
Writes a WordHoard XML file.
Constructor Summary | |
---|---|
XMLWriter(java.io.File file)
Creates a new XMLWriter. |
Method Summary | |
---|---|
void |
addInactiveObserver(java.util.Observer o)
Adds an inactive observer. |
void |
close()
Closes the XMLWriter. |
void |
deleteInactiveObservers()
Deletes all inactive observers. |
void |
endEl(java.lang.String name)
Ends an element. |
static java.lang.String |
escapeXML(java.lang.String str)
Escapes special XML characters. |
boolean |
getActive()
Gets the writer active status. |
void |
setActive(boolean active)
Sets the writer active or inactive. |
void |
startEl(java.lang.String name)
Starts an element. |
void |
startEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1)
Starts an element. |
void |
startEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2)
Starts an element. |
void |
startEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2,
java.lang.String a3,
java.lang.String v3)
Starts an element. |
void |
startEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2,
java.lang.String a3,
java.lang.String v3,
java.lang.String a4,
java.lang.String v4)
Starts an element. |
void |
writeEmptyEl(java.lang.String name)
Writes an empty element. |
void |
writeEscapedString(java.lang.String str)
Writes an escaped string. |
void |
writeString(java.lang.String str)
Writes a string. |
void |
writeTextEl(java.lang.String name,
java.lang.String str)
Writes a text element. |
void |
writeTextEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String str)
Writes a text element. |
void |
writeTextEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2,
java.lang.String str)
Writes a text element. |
void |
writeTextEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2,
java.lang.String a3,
java.lang.String v3,
java.lang.String str)
Writes a text element. |
void |
writeTextEl(java.lang.String name,
java.lang.String a1,
java.lang.String v1,
java.lang.String a2,
java.lang.String v2,
java.lang.String a3,
java.lang.String v3,
java.lang.String a4,
java.lang.String v4,
java.lang.String str)
Writes a text element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLWriter(java.io.File file) throws java.lang.Exception
file
- XML output file.
java.lang.Exception
Method Detail |
---|
public void close() throws java.lang.Exception
java.lang.Exception
public void setActive(boolean active)
If the writer is set inactive, any attempt to write to the file is intercepted and ignored, and any inactive observers are notified.
active
- True if active, false if inactive. public boolean getActive()
public void addInactiveObserver(java.util.Observer o)
The observer is notified whenever an attempt is made to write to the file when the writer is inactive.
o
- Observer. public void deleteInactiveObservers()
public static java.lang.String escapeXML(java.lang.String str)
str
- String.
public void writeString(java.lang.String str)
str
- String. public void writeEscapedString(java.lang.String str)
str
- String. public void startEl(java.lang.String name)
name
- Element name. public void startEl(java.lang.String name, java.lang.String a1, java.lang.String v1)
name
- Element name.a1
- Attribute name.v1
- Attribute value. public void startEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value. public void startEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2, java.lang.String a3, java.lang.String v3)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value.a3
- Third attribute name.v3
- Third attribute value. public void startEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2, java.lang.String a3, java.lang.String v3, java.lang.String a4, java.lang.String v4)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value.a3
- Third attribute name.v3
- Third attribute value.a4
- Fourth attribute name.v4
- Fourth attribute value. public void endEl(java.lang.String name)
name
- Element name. public void writeTextEl(java.lang.String name, java.lang.String str)
name
- Element name.str
- Text contents of element. public void writeTextEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String str)
name
- Element name.a1
- First attribute name.v1
- First attribute value.str
- Text contents of element. public void writeTextEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2, java.lang.String str)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value.str
- Text contents of element. public void writeTextEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2, java.lang.String a3, java.lang.String v3, java.lang.String str)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value.a3
- Second attribute name.v3
- Second attribute value.str
- Text contents of element. public void writeTextEl(java.lang.String name, java.lang.String a1, java.lang.String v1, java.lang.String a2, java.lang.String v2, java.lang.String a3, java.lang.String v3, java.lang.String a4, java.lang.String v4, java.lang.String str)
name
- Element name.a1
- First attribute name.v1
- First attribute value.a2
- Second attribute name.v2
- Second attribute value.a3
- Second attribute name.v3
- Second attribute value.str
- Text contents of element. public void writeEmptyEl(java.lang.String name)
name
- Element name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |