public class XmlPrintStream extends IndentedPrintStream
out| Constructor and Description |
|---|
XmlPrintStream(OutputStream outputStream)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeElement()
Close an element previously created with openElement().
|
String |
escape(String in)
Translate reserved XML characters to XML entities.
|
void |
openElement(String name)
Open an XML element with the given name.
|
void |
openElement(String name,
Map<String,String> attributes)
Open an XML element with the given name, and attributes.
|
void |
openElement(String name,
String... attributes)
Open an XML element with the given name, and attributes.
|
void |
printComment(String comment)
Output a comment.
|
void |
printElement(String name)
Output a complete empty element.
|
void |
printElement(String elementName,
Object value)
Output a complete element with the given content.
|
void |
printElement(String elementName,
String value,
Map<String,String> attributes)
Output a complete element with the given content and attributes.
|
void |
printElement(String name,
String value,
String... attributes)
Output an element with the given content (value).
|
static String |
removeNewLines(String textContent)
Replace multiple newline characters with a single space.
|
align, closeBlock, closeBlock, continueBlock, forceNewLine, getLinePrefix, getOffset, getPrintOffsets, indent, isNoIndent, isNoNl, isoNlCr, isRemoveNl, openBlock, openBlock, outdent, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, printAlignedBlock, printlines, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, println, setLinePrefix, setNoIndent, setNoNl, setoNlCr, setPrintOffsets, setRemoveNlappend, append, append, checkError, clearError, close, flush, format, format, printf, printf, setError, write, writewritepublic XmlPrintStream(OutputStream outputStream)
outputStream - An OutputStream to which the formatted output will be sent.public void openElement(String name)
name - Name of the XML element to open.public void openElement(String name, Map<String,String> attributes)
name - Name of the XML element to open.attributes - A map of name value pairs which will be used to add attributes to
the element.public void openElement(String name, String... attributes)
name - Name of the element.attributes - Attributes in name value pairs.public void closeElement()
public void printElement(String elementName, Object value)
elementName - Name of element.value - Content of element.public void printElement(String name, String value, String... attributes)
name - Name of the element.value - Contents of the element.attributes - Alternate names and values of attributes for the element.public void printElement(String elementName, String value, Map<String,String> attributes)
elementName - Name of element.value - Content of element.attributes - A map of name value pairs which will be used to add attributes to
the element.public void printElement(String name)
name - Name of element.public void printComment(String comment)
comment - Comment text.public String escape(String in)
in - Input string.Copyright © 2018 The Symphony Software Foundation. All rights reserved.