Class FindIndentYaml

  • All Implemented Interfaces:
    org.openrewrite.refactor.FindIndent, org.openrewrite.SourceVisitor<java.lang.Void>, YamlSourceVisitor<java.lang.Void>

    public class FindIndentYaml
    extends AbstractYamlSourceVisitor<java.lang.Void>
    implements org.openrewrite.refactor.FindIndent
    Discover the most common indentation level of a tree, and whether this indentation is built with spaces or tabs.
    • Constructor Detail

      • FindIndentYaml

        public FindIndentYaml​(int enclosingIndent)
    • Method Detail

      • defaultTo

        public java.lang.Void defaultTo​(org.openrewrite.Tree t)
        Specified by:
        defaultTo in interface org.openrewrite.SourceVisitor<java.lang.Void>
      • visitTree

        public java.lang.Void visitTree​(org.openrewrite.Tree tree)
        Specified by:
        visitTree in interface org.openrewrite.SourceVisitor<java.lang.Void>
      • isIndentedWithSpaces

        public boolean isIndentedWithSpaces()
        Specified by:
        isIndentedWithSpaces in interface org.openrewrite.refactor.FindIndent
      • getMostCommonIndent

        public int getMostCommonIndent()
        Specified by:
        getMostCommonIndent in interface org.openrewrite.refactor.FindIndent
      • getTotalLines

        public int getTotalLines()
        Specified by:
        getTotalLines in interface org.openrewrite.refactor.FindIndent
        Returns:
        The total number of source lines that this indent decision was made on.