|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.formats.xml.XmlBuilder
public class XmlBuilder
Builds an XML file via a variety of convenience methods.
XMLBuilder also aids accuracy by correctly escaping illegal symbols in content and attribute values, and by tracking and enforcing tag nesting.
Output is attractively indented at no additional cost.
Copyright 2003-2006 Partner Software, Inc.
| Constructor Summary | |
|---|---|
XmlBuilder(java.io.File outputFile)
|
|
XmlBuilder(VfsFile outputFile)
|
|
XmlBuilder(java.io.Writer writer)
|
|
XmlBuilder(java.io.Writer writer,
boolean printDoctype)
|
|
| Method Summary | |
|---|---|
void |
beginStartTag(java.lang.String tagName)
|
void |
close()
|
void |
endElement()
|
void |
endElement(boolean newLine)
|
void |
endElement(java.lang.String checkTagName)
|
void |
endElement(java.lang.String checkTagName,
boolean newLine)
|
void |
endStartTag()
|
boolean |
isDroppingElementsWithoutContent()
|
boolean |
isEmptyingElementsWithoutContent()
|
void |
setDroppingElementsWithoutContent(boolean droppingElementsWithoutContent)
If set to true, will not output elements specified by writeElement() if the content is null or blank. |
void |
setEmptyingElementsWithoutContent(boolean emptyingElementsWithoutContent)
If set to true, uses the empty element form (e.g. |
void |
startElement(java.lang.String tagName)
|
void |
startElement(java.lang.String tagName,
boolean newLine)
|
void |
startElement(java.lang.String tagName,
java.lang.String... attributes)
|
void |
writeAttribute(java.lang.String name,
java.lang.String value)
|
void |
writeContent(java.lang.Object content)
|
void |
writeContent(java.lang.Object content,
boolean newLine)
|
void |
writeElement(java.lang.String tag,
double content)
|
void |
writeElement(java.lang.String tag,
int content)
|
void |
writeElement(java.lang.String tag,
java.lang.Object content)
|
void |
writeEmptyElement(java.lang.String tagName,
java.lang.String... attributes)
|
void |
writeIterableContent(java.lang.String tagName,
java.lang.Iterable content)
|
void |
writeRaw(java.lang.String text)
This writes text directly to the file, without escaping XML characters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlBuilder(VfsFile outputFile)
throws java.io.IOException
java.io.IOException
public XmlBuilder(java.io.File outputFile)
throws java.io.IOException
java.io.IOException
public XmlBuilder(java.io.Writer writer)
throws java.io.IOException
java.io.IOException
public XmlBuilder(java.io.Writer writer,
boolean printDoctype)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void startElement(java.lang.String tagName)
throws java.io.IOException
java.io.IOException
public void startElement(java.lang.String tagName,
boolean newLine)
throws java.io.IOException
java.io.IOException
public void startElement(java.lang.String tagName,
java.lang.String... attributes)
throws java.io.IOException
java.io.IOException
public void endElement()
throws java.io.IOException
java.io.IOException
public void endElement(boolean newLine)
throws java.io.IOException
java.io.IOException
public void endElement(java.lang.String checkTagName)
throws java.io.IOException
java.io.IOException
public void endElement(java.lang.String checkTagName,
boolean newLine)
throws java.io.IOException
java.io.IOException
public void beginStartTag(java.lang.String tagName)
throws java.io.IOException
java.io.IOException
public void writeAttribute(java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public void endStartTag()
throws java.io.IOException
java.io.IOException
public void writeEmptyElement(java.lang.String tagName,
java.lang.String... attributes)
throws java.io.IOException
java.io.IOException
public void writeElement(java.lang.String tag,
java.lang.Object content)
throws java.io.IOException
java.io.IOException
public void writeElement(java.lang.String tag,
double content)
throws java.io.IOException
java.io.IOException
public void writeElement(java.lang.String tag,
int content)
throws java.io.IOException
java.io.IOException
public void writeContent(java.lang.Object content)
throws java.io.IOException
java.io.IOException
public void writeContent(java.lang.Object content,
boolean newLine)
throws java.io.IOException
java.io.IOException
public void writeIterableContent(java.lang.String tagName,
java.lang.Iterable content)
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
public void writeRaw(java.lang.String text)
throws java.io.IOException
java.io.IOExceptionpublic boolean isDroppingElementsWithoutContent()
public void setDroppingElementsWithoutContent(boolean droppingElementsWithoutContent)
droppingElementsWithoutContent - public boolean isEmptyingElementsWithoutContent()
public void setEmptyingElementsWithoutContent(boolean emptyingElementsWithoutContent)
emptyingElementsWithoutContent -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||