Example usage for Java org.jdom2.output Format fields, constructors, methods, implement or subclass
The text is from its open source code.
String | escapeAttribute(final EscapeStrategy strategy, final String value) This will take the three pre-defined entities in XML 1.0 ('<', '>', and '&' - used specifically in XML elements) as well as CR/NL, tabs, and Quote characters which require escaping inside Attribute values and converts their character representation to the appropriate entity reference suitable for XML attribute content. |
Format | getCompactFormat() Returns a new Format object that performs whitespace normalization, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. |
String | getEncoding() Returns the configured output encoding. |
EscapeStrategy | getEscapeStrategy() Returns the current escape strategy |
Format | getPrettyFormat() Returns a new Format object that performs whitespace beautification with 2-space indents, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. |
Format | getRawFormat() Returns a new Format object that performs no whitespace changes, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. |
Format | setEncoding(String encoding) Sets the output encoding. |
Format | setEscapeStrategy(EscapeStrategy strategy) Sets the EscapeStrategy to use for character escaping. |
Format | setExpandEmptyElements(boolean expandEmptyElements) This will set whether empty elements are expanded from <tagName/> to <tagName></tagName> . |
Format | setIndent(String indent) This will set the indent String to use; this is usually a String of empty spaces. |
Format | setLineSeparator(String separator) This will set the newline separator ( LineSeparator ). |
Format | setLineSeparator(LineSeparator separator) This will set the newline separator sequence. |
Format | setOmitDeclaration(boolean omitDeclaration) This will set whether the XML declaration ( <?xml version="1.0"?> ) will be omitted or not. |
Format | setOmitEncoding(boolean omitEncoding) This will set whether the XML declaration ( <?xml version="1.0" encoding="UTF-8"?> ) includes the encoding of the document. |
Format | setTextMode(Format.TextMode mode) This sets the text output style. |