public class XmlWriter
extends java.lang.Object
Constructor and Description |
---|
XmlWriter(java.io.File outputFile) |
XmlWriter(java.io.OutputStream outputFileStream) |
XmlWriter(java.io.Writer writer,
boolean takeOwnership,
int indentingOffset,
boolean addXmlPrefix)
Create an XmlWriter on top of an existing java.io.Writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this writer.
|
XmlWriter |
endEntity()
End the current entity.
|
static java.lang.String |
escapeXml(java.lang.String str) |
static java.lang.String |
replaceString(java.lang.String text,
java.lang.String repl,
java.lang.String with) |
static java.lang.String |
replaceString(java.lang.String text,
java.lang.String repl,
java.lang.String with,
int max)
Replace a string with another string inside a larger string, for the
first n values of the search string.
|
XmlWriter |
writeAttribute(java.lang.String attr,
java.lang.String value)
Write an attribute out for the current entity.
|
XmlWriter |
writeEntity(java.lang.String name)
Begin to output an entity.
|
XmlWriter |
writeText(java.lang.String text)
Output body text.
|
public XmlWriter(java.io.Writer writer, boolean takeOwnership, int indentingOffset, boolean addXmlPrefix) throws java.io.IOException
java.io.IOException
public XmlWriter(java.io.File outputFile) throws java.io.IOException
java.io.IOException
public XmlWriter(java.io.OutputStream outputFileStream) throws java.io.IOException
java.io.IOException
public XmlWriter writeEntity(java.lang.String name) throws java.io.IOException
name
- String name of entity.java.io.IOException
public XmlWriter writeAttribute(java.lang.String attr, java.lang.String value)
attr
- String name of attribute.value
- String value of attribute.public XmlWriter endEntity() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public XmlWriter writeText(java.lang.String text) throws java.io.IOException
java.io.IOException
public static java.lang.String escapeXml(java.lang.String str)
public static java.lang.String replaceString(java.lang.String text, java.lang.String repl, java.lang.String with)
public static java.lang.String replaceString(java.lang.String text, java.lang.String repl, java.lang.String with, int max)
text
- String to do search and replace inrepl
- String to search forwith
- String to replace withmax
- int values to replace