Uses of Class
eu.maveniverse.domtrip.Element
Packages that use Element
Package
Description
DomTrip - A lossless XML processing library for Java.
-
Uses of Element in eu.maveniverse.domtrip
Methods in eu.maveniverse.domtrip that return ElementModifier and TypeMethodDescriptionEditor.addElement(Element parent, QName qname) Adds a new element using a QName.Editor.addElement(Element parent, QName qname, String textContent) Adds a new element using a QName with text content.Editor.addElement(Element parent, String elementName) Adds a new element as a child of the specified parent elementEditor.addElement(Element parent, String elementName, String textContent) Adds a new element with text contentSets an attribute value, preserving existing formatting when the attribute already exists.Element.attribute(String name, String value, QuoteStyle quoteStyle) Sets an attribute value with a specific quote style.Element.attributeObject(String name, Attribute attribute) Sets an attribute using an Attribute object.Element.attributeQuote(String attributeName, QuoteStyle quoteStyle) Sets the quote character for the specified attribute.Element.attributeWhitespace(String attributeName, String whitespace) Sets the preceding whitespace for the specified attribute.Editor.EditorElementBuilder.build()Builds and adds the element to the document.static ElementCreates a CDATA element.Element.clone()Deprecated.Element.closeTagWhitespace(String whitespace) Sets the whitespace within the closing tag (before the element name).Element.copy()Creates a deep copy of this node.Element.innerPrecedingWhitespace(String whitespace) Sets the whitespace immediately before the closing tag.Editor.insertElementAfter(Element referenceElement, String elementName) Inserts a new element after the specified reference element.Editor.insertElementAfter(Element referenceElement, String elementName, String textContent) Inserts a new element with text content after the specified reference element.Editor.insertElementAt(Element parent, int index, String elementName) Inserts a new element at the specified position within the parent.Editor.insertElementAt(Element parent, int index, String elementName, String textContent) Inserts a new element with text content at the specified position.Editor.insertElementBefore(Element referenceElement, String elementName) Inserts a new element before the specified reference element.Editor.insertElementBefore(Element referenceElement, String elementName, String textContent) Inserts a new element with text content before the specified reference element.Sets the element name.Element.namespaceDeclaration(String prefix, String namespaceURI) Sets a namespace declaration attribute (xmlns or xmlns:prefix).static ElementCreates an element from a QName.static ElementCreates a simple element.Element.openTagWhitespace(String whitespace) Sets the whitespace within the opening tag (before the closing >).Element.originalCloseTag(String originalCloseTag) Set the materialized original closing tag and disable source-backed close-tag slicing.Element.originalOpenTag(String originalOpenTag) Set the materialized original open tag and disable source-backed tag slicing.Element.parent(ContainerNode parent) Sets the parent container node of this node.Node.parentElement()Gets the Element parent of this node.Element.precedingWhitespace(String whitespace) Sets the whitespace that precedes this node.Document.root()Gets the root element of this document.Editor.root()Gets the root element of the document.Element.selfClosing(boolean selfClosing) Sets whether this element should be self-closing.static ElementElement.selfClosing(String name) Creates a self-closing element.static ElementCreates an element from a QName with text content.static ElementCreates a simple text element.Element.textContent(String content) Sets the text content, replacing all existing text children.Element.textPreservingWhitespace(String content) Sets the text content while preserving existing whitespace patterns.Editor.uncommentElement(Comment comment) Uncomments a previously commented element by parsing the comment content back to XML.static ElementElement.withAttributes(String name, Map<String, String> attributes) Creates an element with attributes.static ElementCreates an element with text content and attributes.Methods in eu.maveniverse.domtrip that return types with arguments of type ElementModifier and TypeMethodDescriptionElementQuery.all()Returns all elements matching the query criteria as a Stream.Element.childElement(QName qname) Finds the first child element with the given QName.Element.childElement(String name) Finds the first child element with the given name.Element.childElements()Finds all child elements.Element.childElements(QName qname) Finds all child elements with the given QName.Element.childElements(String name) Finds all child elements with the given name.Element.descendant(QName qname) Finds the first descendant element with the given QName.Element.descendant(String name) Finds the first descendant element with the given name.Element.descendants()Returns a stream of all descendant elements (depth-first traversal).Element.descendants(QName qname) Finds all descendant elements with the given QName.Element.descendants(String name) Finds all descendant elements with the given name (convenience method).ElementQuery.first()Returns the first element matching the query criteria.Node.nextSiblingElement()Gets the next sibling that is an Element.Finds an element by following a path of QNames from this element.Finds an element by following a path of element names from this element.Node.previousSiblingElement()Gets the previous sibling that is an Element.Evaluates a mini-XPath expression against the document root and returns all matching elements.Evaluates a mini-XPath expression against this element and returns all matching elements.Evaluates this expression against the given context element and returns all matching elements.Editor.selectFirst(String expression) Evaluates a mini-XPath expression against the document root and returns the first match.Element.selectFirst(String expression) Evaluates a mini-XPath expression against this element and returns the first match.XPathExpression.selectFirst(Element context) Evaluates this expression against the given context element and returns the first match.ElementQuery.toList()Returns all elements matching the query criteria as a List.Methods in eu.maveniverse.domtrip with parameters of type ElementModifier and TypeMethodDescriptionvoidEditor.addBlankLineAfter(Element element) voidEditor.addBlankLineBefore(Element element) Editor.addElement(Element parent, QName qname) Adds a new element using a QName.Editor.addElement(Element parent, QName qname, String textContent) Adds a new element using a QName with text content.Editor.addElement(Element parent, String elementName) Adds a new element as a child of the specified parent elementEditor.addElement(Element parent, String elementName, String textContent) Adds a new element with text contentvoidEditor.addElements(Element parent, Map<String, String> nameValuePairs) Batch operation to add multiple child elements with text content.voidEditor.addQNameElements(Element parent, Map<QName, String> qnameValuePairs) Batch operation to add multiple child elements with text content using QNames.static NamespaceContextNamespaceResolver.buildNamespaceContext(Element element) Builds a complete namespace context for the given element.Editor.commentOutElement(Element element) Comments out an element by wrapping it in an XML comment.Editor.commentOutElements(Element... elements) Comments out multiple elements as a single block comment.default DomTripVisitor.ActionDomTripVisitor.enterElement(Element element) Called when entering an element during depth-first traversal.default voidDomTripVisitor.exitElement(Element element) Called after all children of an element have been visited.Editor.insertElementAfter(Element referenceElement, String elementName) Inserts a new element after the specified reference element.Editor.insertElementAfter(Element referenceElement, String elementName, String textContent) Inserts a new element with text content after the specified reference element.Editor.insertElementAt(Element parent, int index, String elementName) Inserts a new element at the specified position within the parent.Editor.insertElementAt(Element parent, int index, String elementName, String textContent) Inserts a new element with text content at the specified position.Editor.insertElementBefore(Element referenceElement, String elementName) Inserts a new element before the specified reference element.Editor.insertElementBefore(Element referenceElement, String elementName, String textContent) Inserts a new element with text content before the specified reference element.static booleanNamespaceResolver.isNamespaceInScope(Element element, String namespaceURI) Checks if a namespace URI is in scope for the given element.booleanEditor.removeAttribute(Element element, String name) Remove the specified attribute from the provided element.booleanEditor.removeElement(Element element) Removes an element from its parent with intelligent whitespace handling.static StringNamespaceResolver.resolveNamespaceURI(Element element, String prefix) Resolves the namespace URI for a given prefix in the context of an element.static StringNamespaceResolver.resolvePrefix(Element element, String namespaceURI) Resolves a prefix for a given namespace URI in the context of an element.Sets the root element of this document.Evaluates this expression against the given context element and returns all matching elements.XPathExpression.selectFirst(Element context) Evaluates this expression against the given context element and returns the first match.voidEditor.setAttribute(Element element, String name, String value) Adds or updates an attribute on an element with intelligent formatting preservation.voidEditor.setAttributes(Element element, Map<String, String> attributes) Batch operation to set multiple attributes on an element.voidEditor.setTextContent(Element element, String content) Sets the text content of an element, preserving the node type (CDATA vs plain text) and surrounding whitespace of the existing content.Method parameters in eu.maveniverse.domtrip with type arguments of type ElementModifier and TypeMethodDescriptionTreeWalker.onEnter(Function<Element, DomTripVisitor.Action> handler) Sets the callback invoked when entering each element.Sets the callback invoked when exiting each element.Applies a custom filter predicate. -
Uses of Element in eu.maveniverse.domtrip.sax
Methods in eu.maveniverse.domtrip.sax with parameters of type ElementModifier and TypeMethodDescriptionvoidSAXOutputter.output(Element element, ContentHandler handler) Emits SAX events for the given element subtree to the specified content handler.voidSAXOutputter.output(Element element, ContentHandler handler, LexicalHandler lexicalHandler) Emits SAX events for the given element subtree to the specified handlers.
Element.copy()instead.