public final class FormatStack extends Object
This class is intended as a working-class for in the various outputter implementations. It is inly public so that people extending the Abstract*Processor classes can take advantage of it's functionality.
The value this class adds is:
Constructor and Description |
---|
FormatStack(Format format)
Creates a new FormatStack seeded with the specified Format
|
Modifier and Type | Method and Description |
---|---|
Format.TextMode |
getDefaultMode() |
String |
getEncoding() |
boolean |
getEscapeOutput()
The escapeOutput flag can be set or unset.
|
EscapeStrategy |
getEscapeStrategy() |
String |
getIndent() |
String |
getLevelEOL() |
String |
getLevelIndent() |
String |
getLineSeparator() |
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)
|
String |
getPadLast()
Get the end-of-line indenting sequence for after the last item in an
Element
|
Format.TextMode |
getTextMode() |
boolean |
isExpandEmptyElements() |
boolean |
isIgnoreTrAXEscapingPIs() |
boolean |
isOmitDeclaration() |
boolean |
isOmitEncoding() |
boolean |
isSpecifiedAttributesOnly()
Indicate whether only those Attributes specified in the XML
should be output.
|
void |
pop()
Move back a level on the stack.
|
void |
push()
Create a new depth level on the stack.
|
void |
setEscapeOutput(boolean escape)
The escapeOutput flag can be set or unset.
|
void |
setIgnoreTrAXEscapingPIs(boolean ignoreTrAXEscapingPIs)
Set the current depth's
Format.getIgnoreTrAXEscapingPIs() |
void |
setLevelEOL(String newline)
Set the current depth's End-Of-Line sequence
|
void |
setLevelIndent(String indent)
Override the current depth's accumulated line indent.
|
void |
setTextMode(Format.TextMode mode)
Change the current level's TextMode
|
public FormatStack(Format format)
format
- the Format instance to seed the stack with.public String getIndent()
Format.getIndent()
, may be nullpublic String getLineSeparator()
Format.getLineSeparator()
public String getEncoding()
Format.getEncoding()
public boolean isOmitDeclaration()
Format.getOmitDeclaration()
public boolean isSpecifiedAttributesOnly()
public boolean isOmitEncoding()
Format.getOmitEncoding()
public boolean isExpandEmptyElements()
Format.getExpandEmptyElements()
public EscapeStrategy getEscapeStrategy()
Format.getEscapeStrategy()
public boolean isIgnoreTrAXEscapingPIs()
Format.getIgnoreTrAXEscapingPIs()
public void setIgnoreTrAXEscapingPIs(boolean ignoreTrAXEscapingPIs)
Format.getIgnoreTrAXEscapingPIs()
ignoreTrAXEscapingPIs
- the boolean value to set.public boolean getEscapeOutput()
public void setEscapeOutput(boolean escape)
escape
- what to set the current level's escapeOutput flag to.public Format.TextMode getDefaultMode()
public String getLevelIndent()
public String getPadBetween()
public String getPadLast()
public void setLevelIndent(String indent)
indent
- the indent to set.public String getLevelEOL()
public void setLevelEOL(String newline)
newline
- the new End-Of-Line sequence to set.public Format.TextMode getTextMode()
Format.getTextMode()
public void setTextMode(Format.TextMode mode)
mode
- the new mode to set.public void push()
public void pop()
Copyright ? 2014 Jason Hunter, Brett McLaughlin. All Rights Reserved.