This class is intended as a working-class for in the various outputter implementations. It is only public so that people extending the Abstract*Processor classes can take advantage of its functionality.
The value this class adds is:
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final Format. | |
| private int | |
| private final String | encoding
The encoding format |
| private boolean[] | escapeOutput
escape Output logic - can be changed by |
| private final EscapeStrategy | escapeStrategy
entity escape logic |
| private final boolean | expandEmptyElements
Whether or not to expand empty elements to
<tagName></tagName> - default is |
| private boolean[] | ignoreTrAXEscapingPIs
Whether TrAX output escaping disabling/enabling PIs are ignored or
processed - default is |
| private final String | indent
The default indent is no spaces (as original document) |
| private String[] | levelEOL
The 'current' End-Of-Line |
| private String[] | levelEOLIndent
The padding to put between content items |
| private String[] | levelIndent
The 'current' accumulated indent |
| private final String | lineSeparator
New line separator |
| private Format. | mode
text handling mode |
| private final boolean | omitDeclaration
Whether or not to output the XML declaration - default is
|
| private final boolean | omitEncoding
Whether or not to output the encoding in the XML declaration -
default is |
| private final boolean | specifiedAttributesOnly
Whether or not to output 'specified' Attributes only |
| private String[] | termEOLIndent
The padding to put after the last item (typically one less indent) |
| Access | Constructor and Description |
|---|---|
| public | FormatStack(Format
the Format instance to seed the stack with. format)Creates a new FormatStack seeded with the specified Format |
| Modifier and Type | Method and Description |
|---|---|
| public Format. | Returns: the TextMode that was originally set for this stack before any modifications.
|
| public String | |
| public boolean | Returns: the current depth's escapeOutput flag.The escapeOutput flag can be set or unset. |
| public EscapeStrategy | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | Returns: the String EOL sequence followed by an indent. Null if it should be ignoredGet the end-of-line indenting sequence for before the first item in an Element, as well as between subsequent items (but not after the last item) |
| public String | Returns: the String EOL sequence followed by an indent. Null if it should be ignoredGet the end-of-line indenting sequence for after the last item in an Element |
| public Format. | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if only the specified Attributes should be output, false if those Attributes defaulted from the DTD or XML schema should be output too.Indicate whether only those Attributes specified in the XML should be output. |
| public void | |
| public void | |
| private final void | resetReusableIndents()
If the indent strategy changes part way through a stack, we need to clear the previously calculated reusable 'lower' levels of the stack. |
| public void | setEscapeOutput(boolean
what to set the current level's escapeOutput flag to. escape)The escapeOutput flag can be set or unset. |
| public void | setIgnoreTrAXEscapingPIs(boolean
the boolean value to set. ignoreTrAXEscapingPIs)Set the current depth's |
| public void | setLevelEOL(String
the new End-Of-Line sequence to set. newline)Set the current depth's End-Of-Line sequence |
| public void | setLevelIndent(String
the indent to set. indent)Override the current depth's accumulated line indent. |
| public void |
| capacity | back to summary |
|---|---|
| private int capacity | |
| defaultMode | back to summary |
|---|---|
| private final Format. | |
| depth | back to summary |
|---|---|
| private int depth | |
| encoding | back to summary |
|---|---|
| private final String encoding The encoding format | |
| escapeOutput | back to summary |
|---|---|
| private boolean[] escapeOutput escape Output logic - can be changed by | |
| escapeStrategy | back to summary |
|---|---|
| private final EscapeStrategy escapeStrategy entity escape logic | |
| expandEmptyElements | back to summary |
|---|---|
| private final boolean expandEmptyElements Whether or not to expand empty elements to
<tagName></tagName> - default is | |
| ignoreTrAXEscapingPIs | back to summary |
|---|---|
| private boolean[] ignoreTrAXEscapingPIs Whether TrAX output escaping disabling/enabling PIs are ignored or
processed - default is | |
| indent | back to summary |
|---|---|
| private final String indent The default indent is no spaces (as original document) | |
| levelEOL | back to summary |
|---|---|
| private String[] levelEOL The 'current' End-Of-Line | |
| levelEOLIndent | back to summary |
|---|---|
| private String[] levelEOLIndent The padding to put between content items | |
| levelIndent | back to summary |
|---|---|
| private String[] levelIndent The 'current' accumulated indent | |
| lineSeparator | back to summary |
|---|---|
| private final String lineSeparator New line separator | |
| mode | back to summary |
|---|---|
| private Format. text handling mode | |
| omitDeclaration | back to summary |
|---|---|
| private final boolean omitDeclaration Whether or not to output the XML declaration - default is
| |
| omitEncoding | back to summary |
|---|---|
| private final boolean omitEncoding Whether or not to output the encoding in the XML declaration -
default is | |
| specifiedAttributesOnly | back to summary |
|---|---|
| private final boolean specifiedAttributesOnly Whether or not to output 'specified' Attributes only | |
| termEOLIndent | back to summary |
|---|---|
| private String[] termEOLIndent The padding to put after the last item (typically one less indent) | |
| FormatStack | back to summary |
|---|---|
| public FormatStack(Format format) Creates a new FormatStack seeded with the specified Format
| |
| getDefaultMode | back to summary |
|---|---|
| public Format. | |
| getEncoding | back to summary |
|---|---|
public String getEncoding()
| |
| getEscapeOutput | back to summary |
|---|---|
| public boolean getEscapeOutput() The escapeOutput flag can be set or unset. When set, Element text and Attribute values are 'escaped' so that the output is valid XML. When unset, the Element text and Attribute values are not escaped.
| |
| getEscapeStrategy | back to summary |
|---|---|
public EscapeStrategy getEscapeStrategy()
| |
| getIndent | back to summary |
|---|---|
public String getIndent()
| |
| getLevelEOL | back to summary |
|---|---|
public String getLevelEOL()
| |
| getLevelIndent | back to summary |
|---|---|
public String getLevelIndent()
| |
| getLineSeparator | back to summary |
|---|---|
public String getLineSeparator()
| |
| getPadBetween | back to summary |
|---|---|
| public String getPadBetween() Get the end-of-line indenting sequence for before the first item in an Element, as well as between subsequent items (but not after the last item)
| |
| getPadLast | back to summary |
|---|---|
| public String getPadLast() Get the end-of-line indenting sequence for after the last item in an Element
| |
| getTextMode | back to summary |
|---|---|
public Format.
| |
| isExpandEmptyElements | back to summary |
|---|---|
public boolean isExpandEmptyElements()
| |
| isIgnoreTrAXEscapingPIs | back to summary |
|---|---|
public boolean isIgnoreTrAXEscapingPIs()
| |
| isOmitDeclaration | back to summary |
|---|---|
public boolean isOmitDeclaration()
| |
| isOmitEncoding | back to summary |
|---|---|
public boolean isOmitEncoding()
| |
| isSpecifiedAttributesOnly | back to summary |
|---|---|
| public boolean isSpecifiedAttributesOnly() Indicate whether only those Attributes specified in the XML should be output.
| |
| pop | back to summary |
|---|---|
| public void pop() Move back a level on the stack. | |
| push | back to summary |
|---|---|
| public void push() Create a new depth level on the stack. The previous level's details are copied to this level, and the accumulated indent (if any) is indented further. | |
| resetReusableIndents | back to summary |
|---|---|
| private final void resetReusableIndents() If the indent strategy changes part way through a stack, we need to clear the previously calculated reusable 'lower' levels of the stack. | |
| setEscapeOutput | back to summary |
|---|---|
| public void setEscapeOutput(boolean escape) The escapeOutput flag can be set or unset. When set, Element text and Attribute values are 'escaped' so that the output is valid XML. When unset, the Element text and Attribute values are not escaped.
| |
| setIgnoreTrAXEscapingPIs | back to summary |
|---|---|
| public void setIgnoreTrAXEscapingPIs(boolean ignoreTrAXEscapingPIs) Set the current depth's
| |
| setLevelEOL | back to summary |
|---|---|
| public void setLevelEOL(String newline) Set the current depth's End-Of-Line sequence
| |
| setLevelIndent | back to summary |
|---|---|
| public void setLevelIndent(String indent) Override the current depth's accumulated line indent.
| |
| setTextMode | back to summary |
|---|---|
| public void setTextMode(Format. Change the current level's TextMode | |