public class JavaFormatter
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
static java.lang.String | 
checkEncoding(java.lang.String encoding)
Check the argument of the -encoding option, which should be a valid
 and supported encoding string. 
 | 
static JdkVersion | 
checkSourceOption(java.lang.String source)
Check the argument of the -source option, which should be something
 like '1.5', and should be a JDK version that the formatter supports. 
 | 
static boolean | 
formatFile(java.io.File file,
          JdkVersion jdkVersion,
          SourcePreferences sourcePreferences,
          java.lang.String encoding,
          boolean quiet,
          int indent)
Format one file. 
 | 
static void | 
main(java.lang.String[] args)
Entry point of the stand-alone JavaFormatter. 
 | 
public static boolean formatFile(java.io.File file,
                 JdkVersion jdkVersion,
                 SourcePreferences sourcePreferences,
                 java.lang.String encoding,
                 boolean quiet,
                 int indent)
file - The filejdkVersion - The JdkVersion to use, if null the default JdkVersion is usedsourcePreferences - The preferences for formattingencoding - The encoding, if null the default encoding is usedpublic static JdkVersion checkSourceOption(java.lang.String source)
source - The -source argumentpublic static java.lang.String checkEncoding(java.lang.String encoding)
encoding - The -encoding argument such as UTF-8public static void main(java.lang.String[] args)
args - The arguments for the formatter