public final class DOMSaveOptions extends Object
true
, this suppresses output of the XML
<?xml version="1.0" ... ?>
preamble.
false
.
true
, this suppresses output of the XML DTD
declarations.
false
which will cause the omission
of the DTD declarations.
true
, a newline (U+0a) is rendered
before and after processing instructions and
comments which occur outside the document element.
false
, but defaults to true
if
PRETTY_OUTPUT is used.
true
, empty elements are represented by an
opening tag and a closing tag.
false
, the element is collapsed
when empty.
false
.
true
, attribute values are enclosed with
single quotes (name='myName').
false
, attribute values are enclosed by
double quotes (name="myName").
false
.
true
, the output is UTF-8 encoded.
false
, the output is encoded in some internal default.
false
.
Modifier and Type | Field and Description |
---|---|
static int |
PRETTY_OUTPUT
A display format with carriage returns, indented lines and white
space added
|
static int |
RAW_OUTPUT
A display format where the document is written without any formatting modifications
|
static int |
SIMPLE_OUTPUT
A display format with carriage returns added, but no added white
space
|
Constructor and Description |
---|
DOMSaveOptions()
Instantiates a object with default DOM save options.
|
DOMSaveOptions(DOMSaveOptions oOptions)
Copy constructor
|
DOMSaveOptions(int ePrintFmt,
boolean bExcludePreamble,
boolean bIncludeDTD,
boolean bFormatOutside,
int nIndentLevel,
boolean bExpandElement,
boolean bUseSingleQuoteAttr,
String sEntityChars,
char cRangeMin,
char cRangeMax,
String sDisabledEntityChars,
boolean bIsUTF8,
boolean bSaveTransient,
boolean bSaveFragment)
Instantiates a object with the given DOM save options.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getCanonicalizeNamespaceOrder()
Gets the flag indicating if namespace attributes are to be saved out
in whatever order they exist in, or in the order specified by XML
canonicalization (default namespace first, followed by namespace
prefix definitions in lexicographical order).
|
String |
getDisabledEntityChars()
Returns a string containing the characters that will not be encoded with their entity
references.
|
int |
getDisplayFormat()
Returns the display format.
|
String |
getEntityChars()
Gets the string of characters which will be encoded with their entity
references.
|
boolean |
getExcludePreamble()
Determines if the <?xml version="1.0" ?> preamble is excluded.
|
boolean |
getExpandElement()
Determines if elements are output in their expanded form if empty.
|
boolean |
getFormatOutside()
Determines if nodes outside the the document element are formatted.
|
boolean |
getIncludeDTD()
Determines if DTD declarations are included.
|
int |
getIndentLevel()
Gets the number of spaces used for each level of indentation.
|
char |
getRangeMax()
Gets the character which indicate what the end of the range of characters
to be encoded with their references.
|
char |
getRangeMin()
Gets the character which indicate what the start of the range of
characters to be encoded with their references.
|
boolean |
getSaveFragment()
Determines if transient fragment nodes are written.
|
boolean |
getSaveTransient()
Determines if transient/default nodes are written
|
boolean |
getUseSingleQuoteAttr()
Determines whether attribute values are enclosed with single quotes.
|
void |
setCanonicalizeNamespaceOrder(boolean bCanonicalizeNamespaceOrder)
Sets the flag indicating if namespace attributes are to be saved out
in whatever order they exist in, or in the order specified by XML
canonicalization (default namespace first, followed by namespace
prefix definitions in lexicographical order).
|
void |
setDisabledEntityChars(String sEntityChars)
Sets the string of characters which will not be encoded with their entity
references.
|
void |
setDisplayFormat(int ePrintFmt)
Sets the display format.
|
void |
setEntityChars(String sEntityChars)
Sets the string of characters which will be encoded with their entity
references.
|
void |
setExcludePreamble(boolean bExcludePreamble)
Determines whether the <?xml version="1.0" ?> preamble is excluded.
|
void |
setExpandElement(boolean bExpandElement)
Determines whether elements are written in their expanded form if empty.
|
void |
setFormatOutside(boolean bFormatOutside)
Determines whether nodes outside the the document element are formatted.
|
void |
setIncludeDTD(boolean bIncludeDTD)
Sets if DTD declarations are included.
|
void |
setIndentLevel(int nIndentLevel)
Sets the number of spaces used for each level of indentation.
|
void |
setRangeMax(char cRangeMax)
Sets the character which indicate what the end of the range of characters
to be encoded with their references.
|
void |
setRangeMin(char cRangeMin)
Sets the character which indicate what the start of the range of
characters to be encoded with their references.
|
void |
setSaveFragment(boolean bSaveFragment)
Determines if transient fragment nodes are written.
|
void |
setSaveTransient(boolean bSaveTransient)
Sets the flag indicating if transient/default nodes are saved out.
|
void |
setUseSingleQuoteAttr(boolean bUseSingleQuoteAttr)
Determines whether attribute values are enclosed with single quotes.
|
public static final int PRETTY_OUTPUT
public static final int RAW_OUTPUT
public static final int SIMPLE_OUTPUT
public DOMSaveOptions()
public DOMSaveOptions(DOMSaveOptions oOptions)
public DOMSaveOptions(int ePrintFmt, boolean bExcludePreamble, boolean bIncludeDTD, boolean bFormatOutside, int nIndentLevel, boolean bExpandElement, boolean bUseSingleQuoteAttr, String sEntityChars, char cRangeMin, char cRangeMax, String sDisabledEntityChars, boolean bIsUTF8, boolean bSaveTransient, boolean bSaveFragment)
ePrintFmt
- the serialization format.bExcludePreamble
- exclude the preamble or not.bIncludeDTD
- include the DTD or not.nIndentLevel
- the indentation level.bFormatOutside
- format nodes outside the document element or not.bExpandElement
- expand elements or not.bUseSingleQuoteAttr
- use single quotes or not.sEntityChars
- characters to encode
using entity references [Not currently supported]cRangeMin
- minimum range of characters
to encode using entity references [Not currently supported]cRangeMax
- maximum range of characters
to encode using entity references [Not currently supported]sDisabledEntityChars
- characters not to encode
using entity references [Not currently supported]bIsUTF8
- use UTF-8 encoding or not.public boolean getCanonicalizeNamespaceOrder()
public String getDisabledEntityChars()
public int getDisplayFormat()
PRETTY_OUTPUT
, SIMPLE_OUTPUT
or RAW_OUTPUT
public String getEntityChars()
public boolean getExcludePreamble()
true
if the XML declaration preamble is excluded, else false
.public boolean getExpandElement()
true
if empty elements are written with open and closing tagspublic boolean getFormatOutside()
true
if nodes outside the document element are formatted,
else false
public boolean getIncludeDTD()
true
if DTD declarations
are included, else false
public int getIndentLevel()
public char getRangeMax()
public char getRangeMin()
public boolean getSaveFragment()
AppModel.setExternalProtosAreTransient(boolean)
has been used to
indicate that external protos are transient.true
if transient fragment nodes are written.setSaveFragment(boolean)
public boolean getSaveTransient()
true
if transient/default nodes are written.public boolean getUseSingleQuoteAttr()
true
if attribute values are enclosed by "'",
false
if attribute values are enclosed by """public void setCanonicalizeNamespaceOrder(boolean bCanonicalizeNamespaceOrder)
public void setDisabledEntityChars(String sEntityChars)
sEntityChars
- the string of characters which will not be
encodedpublic void setDisplayFormat(int ePrintFmt)
ePrintFmt
- one of: PRETTY_OUTPUT
, SIMPLE_OUTPUT
or RAW_OUTPUT
public void setEntityChars(String sEntityChars)
sEntityChars
- String of characters which will be encodedpublic void setExcludePreamble(boolean bExcludePreamble)
bExcludePreamble
- true
if the preamble is excluded else false
public void setExpandElement(boolean bExpandElement)
bExpandElement
- true
if empty elements written with
open and closing tagspublic void setFormatOutside(boolean bFormatOutside)
bFormatOutside
- true
if nodes outside the document element
are formatted else false
.public void setIncludeDTD(boolean bIncludeDTD)
bIncludeDTD
- true
if DTD
declarations are included else false
.public void setIndentLevel(int nIndentLevel)
nIndentLevel
- the number of spaces.public void setRangeMax(char cRangeMax)
cRangeMax
- the max character in the range.public void setRangeMin(char cRangeMin)
cRangeMin
- the min character in the range.public void setSaveFragment(boolean bSaveFragment)
AppModel.setExternalProtosAreTransient(boolean)
has been used to
indicate that external protos are transient.bSaveFragment
- true if transient fragment nodes are written.
getSaveFragment()
public void setSaveTransient(boolean bSaveTransient)
public void setUseSingleQuoteAttr(boolean bUseSingleQuoteAttr)
bUseSingleQuoteAttr
- true
if attribute values are enclosed by "'",
false
if by """Copyright © 2010 - 2020 Adobe. All Rights Reserved