Package cdc.util.xml
Enum XmlWriter.Feature
- java.lang.Object
-
- java.lang.Enum<XmlWriter.Feature>
-
- cdc.util.xml.XmlWriter.Feature
-
- All Implemented Interfaces:
Serializable
,Comparable<XmlWriter.Feature>
- Enclosing class:
- XmlWriter
public static enum XmlWriter.Feature extends Enum<XmlWriter.Feature>
Enumeration of features supported by the writer.- Author:
- Damien Carbonne
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLOW_PARTIAL_XML
If enabled, partial xml writing is allowed.ALWAYS_ENTITIZE_ATTRIBUTES
If set, always replaces certain characters by their entity in attributes, even if this is not necessary.ALWAYS_ENTITIZE_ELEMENTS
If set,always replaces certain characters by their corresponding entity in elements.APPEND_FINAL_EOL
If set, and PRETTY_PRINT is also enabled, appends EOL on last line.DONT_VALIDATE_CHARS
If enabled, elements content and attributes values are not checked.DONT_VALIDATE_NAMES
If enabled, elements and attributes names are not checked.PRETTY_PRINT
If set, pretty print output.USE_CONVERTER
If set, use converter for element and attribute names.USE_SINGLE_QUOTE
If set, use single quote instead of double quote for attribute delimiter.USE_XML_EOL
If set, use LF for EOL.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XmlWriter.Feature
valueOf(String name)
Returns the enum constant of this type with the specified name.static XmlWriter.Feature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PRETTY_PRINT
public static final XmlWriter.Feature PRETTY_PRINT
If set, pretty print output.
-
USE_XML_EOL
public static final XmlWriter.Feature USE_XML_EOL
If set, use LF for EOL.Otherwise, use platform way to mark EOL.
This applies to text, comments and attributes.
-
APPEND_FINAL_EOL
public static final XmlWriter.Feature APPEND_FINAL_EOL
If set, and PRETTY_PRINT is also enabled, appends EOL on last line.Otherwise, last line does not end with EOL.
-
USE_SINGLE_QUOTE
public static final XmlWriter.Feature USE_SINGLE_QUOTE
If set, use single quote instead of double quote for attribute delimiter.
-
ALWAYS_ENTITIZE_ATTRIBUTES
public static final XmlWriter.Feature ALWAYS_ENTITIZE_ATTRIBUTES
If set, always replaces certain characters by their entity in attributes, even if this is not necessary.'
is replaced even if delimiter is"
."
is replaced even if delimiter is'
.>
is replaced even if not mandatory.
\t
, which is always replaced.\n
, which is always replaced.\r
, which is always replaced.&
, which is always replaced.<
, which is always replaced.
-
ALWAYS_ENTITIZE_ELEMENTS
public static final XmlWriter.Feature ALWAYS_ENTITIZE_ELEMENTS
If set,always replaces certain characters by their corresponding entity in elements.
-
USE_CONVERTER
public static final XmlWriter.Feature USE_CONVERTER
If set, use converter for element and attribute names.
-
ALLOW_PARTIAL_XML
public static final XmlWriter.Feature ALLOW_PARTIAL_XML
If enabled, partial xml writing is allowed.Otherwise, only xml documents (and their content) can be produced.
This option must be set to allow generating, for example:- A pure comment:
<!-- a comment -->
- An element (and its content):
<element att="value"/>
- A pure comment:
-
DONT_VALIDATE_NAMES
public static final XmlWriter.Feature DONT_VALIDATE_NAMES
If enabled, elements and attributes names are not checked.
-
DONT_VALIDATE_CHARS
public static final XmlWriter.Feature DONT_VALIDATE_CHARS
If enabled, elements content and attributes values are not checked.
-
-
Method Detail
-
values
public static XmlWriter.Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (XmlWriter.Feature c : XmlWriter.Feature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static XmlWriter.Feature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-