Package org.openrewrite.xml.tree
Class Xml.Tag
java.lang.Object
org.openrewrite.xml.tree.Xml.Tag
- Enclosing interface:
- Xml
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.openrewrite.xml.tree.Xml
Xml.Attribute, Xml.CharData, Xml.Comment, Xml.DocTypeDecl, Xml.Document, Xml.Element, Xml.Ident, Xml.ProcessingInstruction, Xml.Prolog, Xml.Tag, Xml.XmlDecl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P> XmlacceptXml(XmlVisitor<P> v, P p) static Xml.TaggetChildren(String name) getChildValue(String name) A shortcut forgetChild(String)andgetValue().getSibling(String name, org.openrewrite.Cursor cursor) getValue()toString()withChildValue(String childName, String text) Locate a child tag with the given name and set its text value.withContent(@Nullable List<? extends Content> content) withPrefix(String prefix) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openrewrite.Tree
cast, getId, getJacksonPolymorphicTypeTag, getMarkers, isScope, print, print, print, printer, printTrimmed, printTrimmed, printTrimmed, safeCast, withId, withMarkersMethods inherited from interface org.openrewrite.xml.tree.Xml
accept, isAcceptable, withPrefixUnsafe
-
Constructor Details
-
Tag
public Tag()
-
-
Method Details
-
withPrefix
- Specified by:
withPrefixin interfaceXml
-
getPrefix
-
build
-
withName
-
withValue
-
getChild
-
getChildren
-
getChildren
-
withChildValue
Locate a child tag with the given name and set its text value.- Parameters:
childName- The child tag to locate. This assumes there is one and only one.text- The text value to set.- Returns:
- This tag.
-
getValue
- Returns:
- If this tag's content is only character data, consider it the value.
-
getChildValue
A shortcut forgetChild(String)andgetValue().- Parameters:
name- The name of the child element to look for.- Returns:
- The character data of the first child element matching the provided name, if any.
-
getSibling
-
withContent
-
acceptXml
-
toString
-