| java.lang.Object org.jfree.xml.writer.XMLWriterSupport
All known Subclasses: org.jfree.xml.writer.XMLWriter,
XMLWriterSupport | public class XMLWriterSupport (Code) | | A support class for writing XML files.
author: Thomas Morgner |
Field Summary | |
final public static boolean | CLOSE A constant for close. | final public static int | CLOSE_TAG_DECREASE A constant for controlling the indent function. | final public static int | INDENT_ONLY A constant for controlling the indent function. | final public static boolean | OPEN A constant for open. | final public static int | OPEN_TAG_INCREASE A constant for controlling the indent function. |
Method Summary | |
public void | allowLineBreak() Forces a linebreak on the next call to writeTag or writeCloseTag. | protected void | decreaseIndent() Decreates the indention by one level. | public void | endBlock() Ends the current block by decreasing the indent level. | public int | getIndentLevel() Returns the current indent level. | public static String | getLineSeparator() Returns the line separator. | public SafeTagList | getSafeTags() Returns the list of safe tags. | protected void | increaseIndent() Increases the indention by one level. | public void | indent(Writer writer, int increase) Indent the line. | public static String | normalize(String s) Normalises a string, replacing certain characters with their escape
sequences so that the XML text is not corrupted.
Parameters: s - the string. | public void | startBlock() Starts a new block by increasing the indent level. | public void | writeCloseTag(Writer w, String tag) Writes a closing XML tag. | public void | writeTag(Writer w, String name) Writes an opening XML tag that has no attributes. | public void | writeTag(Writer w, String name, String attributeName, String attributeValue, boolean close) Writes an opening XML tag with an attribute/value pair. | public void | writeTag(Writer w, String name, Properties attributes, boolean close) Writes an opening XML tag along with a list of attribute/value pairs. | public void | writeTag(Writer w, String name, AttributeList attributes, boolean close) Writes an opening XML tag along with a list of attribute/value pairs.
Parameters: w - the writer. Parameters: name - the tag name. Parameters: attributes - the attributes. Parameters: close - controls whether the tag is closed. throws: java.io.IOException - if there is an I/O problem. |
CLOSE | final public static boolean CLOSE(Code) | | A constant for close.
|
CLOSE_TAG_DECREASE | final public static int CLOSE_TAG_DECREASE(Code) | | A constant for controlling the indent function.
|
INDENT_ONLY | final public static int INDENT_ONLY(Code) | | A constant for controlling the indent function.
|
OPEN | final public static boolean OPEN(Code) | | A constant for open.
|
OPEN_TAG_INCREASE | final public static int OPEN_TAG_INCREASE(Code) | | A constant for controlling the indent function.
|
XMLWriterSupport | public XMLWriterSupport()(Code) | | Default Constructor. The created XMLWriterSupport will not have no safe
tags and starts with an indention level of 0.
|
XMLWriterSupport | public XMLWriterSupport(SafeTagList safeTags, int indentLevel)(Code) | | Creates a new support instance.
Parameters: safeTags - tags that are safe for line breaks. Parameters: indentLevel - the index level. |
XMLWriterSupport | public XMLWriterSupport(SafeTagList safeTags, int indentLevel, String indentString)(Code) | | Creates a new support instance.
Parameters: safeTags - the tags that are safe for line breaks. Parameters: indentLevel - the indent level. Parameters: indentString - the indent string. |
allowLineBreak | public void allowLineBreak() throws IOException(Code) | | Forces a linebreak on the next call to writeTag or writeCloseTag.
throws: IOException - if an IO error occurs. |
decreaseIndent | protected void decreaseIndent()(Code) | | Decreates the indention by one level.
|
endBlock | public void endBlock() throws IOException(Code) | | Ends the current block by decreasing the indent level.
throws: IOException - if an IO error occurs. |
getIndentLevel | public int getIndentLevel()(Code) | | Returns the current indent level.
the current indent level. |
getLineSeparator | public static String getLineSeparator()(Code) | | Returns the line separator.
the line separator. |
getSafeTags | public SafeTagList getSafeTags()(Code) | | Returns the list of safe tags.
The list. |
increaseIndent | protected void increaseIndent()(Code) | | Increases the indention by one level.
|
indent | public void indent(Writer writer, int increase) throws IOException(Code) | | Indent the line. Called for proper indenting in various places.
Parameters: writer - the writer which should receive the indentention. Parameters: increase - the current indent level. throws: java.io.IOException - if writing the stream failed. |
normalize | public static String normalize(String s)(Code) | | Normalises a string, replacing certain characters with their escape
sequences so that the XML text is not corrupted.
Parameters: s - the string. the normalised string. |
startBlock | public void startBlock() throws IOException(Code) | | Starts a new block by increasing the indent level.
throws: IOException - if an IO error occurs. |
writeTag | public void writeTag(Writer w, String name) throws IOException(Code) | | Writes an opening XML tag that has no attributes.
Parameters: w - the writer. Parameters: name - the tag name. throws: java.io.IOException - if there is an I/O problem. |
writeTag | public void writeTag(Writer w, String name, String attributeName, String attributeValue, boolean close) throws IOException(Code) | | Writes an opening XML tag with an attribute/value pair.
Parameters: w - the writer. Parameters: name - the tag name. Parameters: attributeName - the attribute name. Parameters: attributeValue - the attribute value. Parameters: close - controls whether the tag is closed. throws: java.io.IOException - if there is an I/O problem. |
writeTag | public void writeTag(Writer w, String name, Properties attributes, boolean close) throws IOException(Code) | | Writes an opening XML tag along with a list of attribute/value pairs.
Parameters: w - the writer. Parameters: name - the tag name. Parameters: attributes - the attributes. Parameters: close - controls whether the tag is closed. throws: java.io.IOException - if there is an I/O problem. |
writeTag | public void writeTag(Writer w, String name, AttributeList attributes, boolean close) throws IOException(Code) | | Writes an opening XML tag along with a list of attribute/value pairs.
Parameters: w - the writer. Parameters: name - the tag name. Parameters: attributes - the attributes. Parameters: close - controls whether the tag is closed. throws: java.io.IOException - if there is an I/O problem. |
|
|