Class AutodetectGeneralFormatStyle

java.lang.Object
org.openrewrite.TreeVisitor<org.openrewrite.xml.tree.Xml,P>
org.openrewrite.xml.XmlVisitor<org.openrewrite.xml.format.LineEndingsCount>
org.openrewrite.xml.format.AutodetectGeneralFormatStyle

public class AutodetectGeneralFormatStyle extends org.openrewrite.xml.XmlVisitor<org.openrewrite.xml.format.LineEndingsCount>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.openrewrite.style.GeneralFormatStyle
    autodetectGeneralFormatStyle(org.openrewrite.xml.tree.Xml.Document x)
    Makes a best-effort attempt to determine whether windows-style (CRLF) line endings or unix-style (LF) are more common in the supplied AST.
    @Nullable org.openrewrite.xml.tree.Xml
    visit(@Nullable org.openrewrite.Tree tree, org.openrewrite.xml.format.LineEndingsCount count)
     

    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, visitTag, 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, 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

    • AutodetectGeneralFormatStyle

      public AutodetectGeneralFormatStyle()
  • Method Details

    • autodetectGeneralFormatStyle

      public static org.openrewrite.style.GeneralFormatStyle autodetectGeneralFormatStyle(org.openrewrite.xml.tree.Xml.Document x)
      Makes a best-effort attempt to determine whether windows-style (CRLF) line endings or unix-style (LF) are more common in the supplied AST.
    • visit

      public @Nullable org.openrewrite.xml.tree.Xml visit(@Nullable org.openrewrite.Tree tree, org.openrewrite.xml.format.LineEndingsCount count)
      Overrides:
      visit in class org.openrewrite.TreeVisitor<org.openrewrite.xml.tree.Xml,org.openrewrite.xml.format.LineEndingsCount>