Class AddToTagVisitor<P>

java.lang.Object
org.openrewrite.TreeVisitor<org.openrewrite.xml.tree.Xml,P>
org.openrewrite.xml.XmlVisitor<P>
org.openrewrite.xml.AddToTagVisitor<P>

public class AddToTagVisitor<P> extends org.openrewrite.xml.XmlVisitor<P>
  • Constructor Summary

    Constructors
    Constructor
    Description
    AddToTagVisitor(org.openrewrite.xml.tree.Xml.Tag scope, org.openrewrite.xml.tree.Xml.Tag tagToAdd)
     
    AddToTagVisitor(org.openrewrite.xml.tree.Xml.Tag scope, org.openrewrite.xml.tree.Xml.Tag tagToAdd, @Nullable Comparator<Content> tagComparator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.openrewrite.xml.tree.Xml.Tag
    addToTag(org.openrewrite.xml.tree.Xml.Tag parent, org.openrewrite.xml.tree.Xml.Tag newChild, org.openrewrite.Cursor parentCursor)
    Add a tag to the children of another tag
    static org.openrewrite.xml.tree.Xml.Tag
    addToTag(org.openrewrite.xml.tree.Xml.Tag parentScope, org.openrewrite.xml.tree.Xml.Tag parent, org.openrewrite.xml.tree.Xml.Tag newChild, org.openrewrite.Cursor parentCursor)
    Add a tag to the children of another tag
    org.openrewrite.xml.tree.Xml
    visitTag(org.openrewrite.xml.tree.Xml.Tag t, P p)
     

    Methods inherited from class org.openrewrite.xml.XmlVisitor

    autoFormat, autoFormat, autoFormat, getLanguage, isAcceptable, maybeAutoFormat, maybeAutoFormat, maybeAutoFormat, visitAttribute, visitAttributeValue, visitCharData, visitComment, visitDocTypeDecl, visitDocTypeDeclExternalSubsets, visitDocument, visitElement, visitIdent, visitJspDirective, visitProcessingInstruction, visitProlog, visitTagClosing, visitXmlDecl

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AddToTagVisitor

      public AddToTagVisitor(org.openrewrite.xml.tree.Xml.Tag scope, org.openrewrite.xml.tree.Xml.Tag tagToAdd)
    • AddToTagVisitor

      public AddToTagVisitor(org.openrewrite.xml.tree.Xml.Tag scope, org.openrewrite.xml.tree.Xml.Tag tagToAdd, @Nullable Comparator<Content> tagComparator)
  • Method Details

    • visitTag

      public org.openrewrite.xml.tree.Xml visitTag(org.openrewrite.xml.tree.Xml.Tag t, P p)
      Overrides:
      visitTag in class org.openrewrite.xml.XmlVisitor<P>
    • addToTag

      public static org.openrewrite.xml.tree.Xml.Tag addToTag(org.openrewrite.xml.tree.Xml.Tag parent, org.openrewrite.xml.tree.Xml.Tag newChild, org.openrewrite.Cursor parentCursor)
      Add a tag to the children of another tag
      Parameters:
      parent - the tag that will have 'newChild' added to its children
      newChild - the tag to add as a child of 'parent'
      parentCursor - A cursor pointing one level above 'parent'. Determines the final indentation of 'newChild'.
      Returns:
      'parent' with 'newChild' amongst its child elements
    • addToTag

      public static org.openrewrite.xml.tree.Xml.Tag addToTag(org.openrewrite.xml.tree.Xml.Tag parentScope, org.openrewrite.xml.tree.Xml.Tag parent, org.openrewrite.xml.tree.Xml.Tag newChild, org.openrewrite.Cursor parentCursor)
      Add a tag to the children of another tag
      Parameters:
      parentScope - a tag which contains 'parent' as a direct or transitive child element.
      parent - the tag that will have 'newChild' added to its children
      newChild - the tag to add as a child of 'parent'
      parentCursor - A cursor pointing one level above 'parentScope'. Determines the final indentation of 'newChild'.
      Returns:
      'parentScope' which somewhere contains 'parent' with 'newChild' amongst its child elements