Package org.openrewrite.yaml.search
Class FindIndentYaml
- java.lang.Object
-
- org.openrewrite.AbstractSourceVisitor<R>
-
- org.openrewrite.yaml.AbstractYamlSourceVisitor<java.lang.Void>
-
- org.openrewrite.yaml.search.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 Summary
Constructors Constructor Description FindIndentYaml(int enclosingIndent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.VoiddefaultTo(org.openrewrite.Tree t)intgetMostCommonIndent()intgetTotalLines()booleanisIndentedWithSpaces()java.lang.VoidvisitTree(org.openrewrite.Tree tree)-
Methods inherited from class org.openrewrite.yaml.AbstractYamlSourceVisitor
visitDocument, visitDocuments, visitMapping, visitMappingEntry, visitScalar, visitSequence, visitSequenceEntry
-
Methods inherited from class org.openrewrite.AbstractSourceVisitor
getCursor, setCursoringOn, visit, visitAfter, visitAfter
-
-
-
-
Method Detail
-
defaultTo
public java.lang.Void defaultTo(org.openrewrite.Tree t)
- Specified by:
defaultToin interfaceorg.openrewrite.SourceVisitor<java.lang.Void>
-
visitTree
public java.lang.Void visitTree(org.openrewrite.Tree tree)
- Specified by:
visitTreein interfaceorg.openrewrite.SourceVisitor<java.lang.Void>
-
isIndentedWithSpaces
public boolean isIndentedWithSpaces()
- Specified by:
isIndentedWithSpacesin interfaceorg.openrewrite.refactor.FindIndent
-
getMostCommonIndent
public int getMostCommonIndent()
- Specified by:
getMostCommonIndentin interfaceorg.openrewrite.refactor.FindIndent
-
getTotalLines
public int getTotalLines()
- Specified by:
getTotalLinesin interfaceorg.openrewrite.refactor.FindIndent- Returns:
- The total number of source lines that this indent decision was made on.
-
-