Class IndentationDetector

java.lang.Object
spoon.support.sniper.internal.IndentationDetector

public class IndentationDetector extends Object
Utility class for detecting the indentation style used in a compilation unit.
  • Method Details

    • detectIndentation

      public static org.apache.commons.lang3.tuple.Pair<Integer,​Boolean> detectIndentation(CtCompilationUnit cu)
      Detect the indentation style of the given compilation unit as 1, 2 or 4 spaces or tabs by inspecting the whitespace preceding type members of top-level type declarations.
      Parameters:
      cu - A compilation unit.
      Returns:
      A pair on the form (indentationSize, isTabs)