1 package com.puppycrawl.tools.checkstyle.checks; 20 21 import com.puppycrawl.tools.checkstyle.api.Check; 22 import com.puppycrawl.tools.checkstyle.api.DetailAST; 23 import com.puppycrawl.tools.checkstyle.api.FileContents; 24 25 32 public class FileContentsHolder 33 extends Check 34 { 35 36 private static final ThreadLocal FILE_CONTENTS = new ThreadLocal (); 37 38 39 public static FileContents getContents() 40 { 41 return (FileContents) FILE_CONTENTS.get(); 42 } 43 44 45 public int[] getDefaultTokens() 46 { 47 return new int[0]; 48 } 49 50 51 public void beginTree(DetailAST aRootAST) 52 { 53 FILE_CONTENTS.set(getFileContents()); 54 } 55 56 57 public void finishTree(DetailAST aRootAST) 58 { 59 } 63 } 64 | Popular Tags |