Comment |
Editor.addComment(ContainerNode parent,
java.lang.String content) |
Adds a comment as a child of the specified parent
|
Element |
Editor.addElement(Element parent,
QName qname) |
Adds a new element using a QName.
|
Element |
Editor.addElement(Element parent,
QName qname,
java.lang.String textContent) |
Adds a new element using a QName with text content.
|
Element |
Editor.addElement(Element parent,
java.lang.String elementName) |
Adds a new element as a child of the specified parent element
|
Element |
Editor.addElement(Element parent,
java.lang.String elementName,
java.lang.String textContent) |
Adds a new element with text content
|
void |
Editor.addElements(Element parent,
java.util.Map<java.lang.String,java.lang.String> nameValuePairs) |
Batch operation to add multiple child elements with text content.
|
void |
Editor.addQNameElements(Element parent,
java.util.Map<QName,java.lang.String> qnameValuePairs) |
Batch operation to add multiple child elements with text content using QNames.
|
Comment |
Editor.EditorCommentBuilder.build() |
Builds and adds the comment to the document.
|
Element |
Editor.EditorElementBuilder.build() |
Builds and adds the element to the document.
|
Text |
Editor.EditorTextBuilder.build() |
Builds and adds the text node to the document.
|
static Element |
Element.cdata(java.lang.String name,
java.lang.String content) |
Creates a CDATA element.
|
Comment |
Editor.commentOutElement(Element element) |
Comments out an element by wrapping it in an XML comment.
|
Comment |
Editor.commentOutElements(Element... elements) |
Comments out multiple elements as a single block comment.
|
void |
Editor.createDocument(java.lang.String rootElementName) |
Creates a new XML document with the specified root element.
|
Editor.EditorElementBuilder |
Editor.NodeBuilder.element(QName qname) |
Creates an element builder using a QName that will be added to the document.
|
Editor.EditorElementBuilder |
Editor.NodeBuilder.element(java.lang.String name) |
Creates an element builder that will be added to the document.
|
static QuoteStyle |
QuoteStyle.fromChar(char c) |
Returns the QuoteStyle corresponding to the given character.
|
Element |
Editor.insertElementAfter(Element referenceElement,
java.lang.String elementName) |
Inserts a new element after the specified reference element.
|
Element |
Editor.insertElementAfter(Element referenceElement,
java.lang.String elementName,
java.lang.String textContent) |
Inserts a new element with text content after the specified reference element.
|
Element |
Editor.insertElementAt(Element parent,
int index,
java.lang.String elementName) |
Inserts a new element at the specified position within the parent.
|
Element |
Editor.insertElementAt(Element parent,
int index,
java.lang.String elementName,
java.lang.String textContent) |
Inserts a new element with text content at the specified position.
|
Element |
Editor.insertElementBefore(Element referenceElement,
java.lang.String elementName) |
Inserts a new element before the specified reference element.
|
Element |
Editor.insertElementBefore(Element referenceElement,
java.lang.String elementName,
java.lang.String textContent) |
Inserts a new element with text content before the specified reference element.
|
static Document |
Document.minimal(java.lang.String rootElementName) |
Creates a minimal document with just a root element (no XML declaration).
|
static Attribute |
Attribute.of(QName qname,
java.lang.String value) |
Creates an attribute from a QName and value.
|
static Document |
Document.of(java.io.InputStream inputStream) |
Creates a document by parsing XML from an InputStream with automatic encoding detection.
|
static Document |
Document.of(java.io.InputStream inputStream,
java.lang.String defaultEncoding) |
Creates a document by parsing XML from an InputStream with encoding detection and fallback.
|
static Document |
Document.of(java.io.InputStream inputStream,
java.nio.charset.Charset defaultCharset) |
Creates a document by parsing XML from an InputStream with encoding detection and fallback.
|
static Document |
Document.of(java.lang.String xml) |
Creates a document by parsing the provided XML string.
|
static Document |
Document.of(java.nio.file.Path path) |
Creates a document by parsing XML from a file path with automatic encoding detection.
|
static Element |
Element.of(QName qname) |
Creates an element from a QName.
|
static Element |
Element.of(java.lang.String name) |
Creates a simple element.
|
static QName |
QName.of(java.lang.String localName) |
Creates a QName for an element with no namespace.
|
static QName |
QName.of(java.lang.String namespaceURI,
java.lang.String localName) |
Creates a QName with the specified namespace URI and local name.
|
static QName |
QName.of(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String prefix) |
Creates a QName with the specified namespace URI, local name, and preferred prefix.
|
Document |
Parser.parse(java.io.InputStream inputStream) |
Parses XML from an InputStream with automatic encoding detection.
|
Document |
Parser.parse(java.io.InputStream inputStream,
java.lang.String defaultEncoding) |
Parses XML from an InputStream with encoding detection and fallback.
|
Document |
Parser.parse(java.io.InputStream inputStream,
java.nio.charset.Charset defaultCharset) |
Parses XML from an InputStream with encoding detection and fallback.
|
Document |
Parser.parse(java.lang.String xml) |
Parses an XML string into a lossless XML document tree.
|
static QName |
QName.parse(java.lang.String qualifiedName) |
Parses a qualified name string into a QName.
|
static java.util.List<Node> |
Document.parseFragment(java.lang.String xml) |
Parses an XML fragment into a list of nodes.
|
Element |
Editor.root() |
Gets the root element of the document.
|
static Element |
Element.selfClosing(java.lang.String name) |
Creates a self-closing element.
|
void |
Serializer.serialize(Document document,
java.io.OutputStream outputStream) |
Serializes an XML document to an OutputStream using the document's encoding.
|
void |
Serializer.serialize(Document document,
java.io.OutputStream outputStream,
java.lang.String encoding) |
Serializes an XML document to an OutputStream using the specified encoding.
|
void |
Serializer.serialize(Document document,
java.io.OutputStream outputStream,
java.nio.charset.Charset charset) |
Serializes an XML document to an OutputStream using the specified charset.
|
void |
Serializer.serialize(Node node,
java.io.OutputStream outputStream) |
Serializes a single node to an OutputStream using UTF-8 encoding.
|
void |
Serializer.serialize(Node node,
java.io.OutputStream outputStream,
java.lang.String encoding) |
Serializes a single node to an OutputStream using the specified encoding.
|
void |
Serializer.serialize(Node node,
java.io.OutputStream outputStream,
java.nio.charset.Charset charset) |
Serializes a single node to an OutputStream using the specified charset.
|
void |
Editor.setAttribute(Element element,
java.lang.String name,
java.lang.String value) |
Adds or updates an attribute on an element with intelligent formatting preservation.
|
void |
Editor.setAttributes(Element element,
java.util.Map<java.lang.String,java.lang.String> attributes) |
Batch operation to set multiple attributes on an element.
|
void |
Editor.setTextContent(Element element,
java.lang.String content) |
Sets the text content of an element, preserving the node type (CDATA vs plain text)
and surrounding whitespace of the existing content.
|
static Element |
Element.text(QName qname,
java.lang.String content) |
Creates an element from a QName with text content.
|
static Element |
Element.text(java.lang.String name,
java.lang.String content) |
Creates a simple text element.
|
void |
Document.toXml(java.io.OutputStream outputStream) |
Serializes this document to an OutputStream using the document's encoding.
|
void |
Document.toXml(java.io.OutputStream outputStream,
java.lang.String encoding) |
Serializes this document to an OutputStream using the specified encoding.
|
void |
Document.toXml(java.io.OutputStream outputStream,
java.nio.charset.Charset charset) |
Serializes this document to an OutputStream using the specified charset.
|
Element |
Editor.uncommentElement(Comment comment) |
Uncomments a previously commented element by parsing the comment content back to XML.
|
static Element |
Element.withAttributes(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes) |
Creates an element with attributes.
|
QName |
QName.withNamespaceURI(java.lang.String newNamespaceURI) |
Creates a new QName with the same local name and prefix but different namespace URI.
|
QName |
QName.withPrefix(java.lang.String newPrefix) |
Creates a new QName with the same namespace URI and local name but different prefix.
|
static Document |
Document.withRootElement(java.lang.String rootElementName) |
Creates a document with a root element and XML declaration.
|
static Element |
Element.withTextAndAttributes(java.lang.String name,
java.lang.String content,
java.util.Map<java.lang.String,java.lang.String> attributes) |
Creates an element with text content and attributes.
|