Package org.openrewrite.xml
Class MapTagChildrenVisitor<T>
java.lang.Object
org.openrewrite.TreeVisitor<Xml,P>
org.openrewrite.xml.XmlVisitor<T>
org.openrewrite.xml.MapTagChildrenVisitor<T>
Applies a transformation to the children of the specified tag.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Xml.TagmapChildren(Xml.Tag parent, UnaryOperator<Content> map) Transform the children of a tag with the supplied mapping function.static Xml.TagmapChildren(Xml.Tag parentScope, Xml.Tag parent, UnaryOperator<Content> map) Transform the children of a tag with the supplied mapping function.static Xml.TagmapTagChildren(Xml.Tag parent, UnaryOperator<Xml.Tag> map) static Xml.TagmapTagChildren(Xml.Tag parentScope, Xml.Tag parent, UnaryOperator<Xml.Tag> map) Methods inherited from class org.openrewrite.xml.XmlVisitor
autoFormat, autoFormat, autoFormat, getLanguage, isAcceptable, maybeAutoFormat, maybeAutoFormat, maybeAutoFormat, visitAttribute, visitCharData, visitComment, visitDocTypeDecl, visitDocument, visitElement, visitIdent, visitProcessingInstruction, visitProlog, visitXmlDeclMethods inherited from class org.openrewrite.TreeVisitor
adapt, collect, collect, defaultValue, doAfterVisit, getAfterVisit, getCursor, isAdaptableTo, noop, postVisit, preVisit, reduce, reduce, reduce, setCursor, stopAfterPreVisit, updateCursor, visit, visit, visit, visitAndCast, visitAndCast, visitMarker, visitMarkers, visitNonNull, visitNonNull, visitorTreeType
-
Field Details
-
scope
-
map
-
-
Constructor Details
-
MapTagChildrenVisitor
public MapTagChildrenVisitor()
-
-
Method Details
-
visitTag
- Overrides:
visitTagin classXmlVisitor<T>
-
mapChildren
Transform the children of a tag with the supplied mapping function.- Parameters:
parent- the tag whose direct child elements are to be transformed by 'map'.map- the function used to transform the direct child elements of 'parent'.- Returns:
- 'parent' with its children transformed by 'map'
-
mapChildren
Transform the children of a tag with the supplied mapping function.- Parameters:
parentScope- a tag which contains 'parent' as a direct or transitive child element.parent- the tag whose direct child elements are to be transformed by 'map'.map- the function used to transform the direct child elements of 'parent'.- Returns:
- 'parentScope' which somewhere contains 'parent' with its children transformed by 'map'
-
mapTagChildren
-
mapTagChildren
public static Xml.Tag mapTagChildren(Xml.Tag parentScope, Xml.Tag parent, UnaryOperator<Xml.Tag> map)
-