com.sun.tools.javac.main
Enum JavaCompiler.CompilePolicy

java.lang.Object
  extended by java.lang.Enum<JavaCompiler.CompilePolicy>
      extended by com.sun.tools.javac.main.JavaCompiler.CompilePolicy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<JavaCompiler.CompilePolicy>
Enclosing class:
JavaCompiler

protected static enum JavaCompiler.CompilePolicy
extends java.lang.Enum<JavaCompiler.CompilePolicy>

Control how the compiler's latter phases (attr, flow, desugar, generate) are connected. Each individual file is processed by each phase in turn, but with different compile policies, you can control the order in which each class is processed through its next phase.

Generally speaking, the compiler will "fail fast" in the face of errors, although not aggressively so. flow, desugar, etc become no-ops once any errors have occurred. No attempt is currently made to determine if it might be safe to process a class through its next phase because it does not depend on any unrelated errors that might have occurred.


Enum Constant Summary
ATTR_ONLY
          Just attribute the parse trees.
BY_FILE
          Groups the classes for each source file together, then process each group in a manner equivalent to the SIMPLE policy.
BY_TODO
          Completely process each entry on the todo list in turn.
CHECK_ONLY
          Just attribute and do flow analysis on the parse trees.
SIMPLE
          Attribute everything, then do flow analysis for everything, then desugar everything, and only then generate output.
 
Method Summary
(package private) static JavaCompiler.CompilePolicy decode(java.lang.String option)
           
static JavaCompiler.CompilePolicy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static JavaCompiler.CompilePolicy[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ATTR_ONLY

public static final JavaCompiler.CompilePolicy ATTR_ONLY
Just attribute the parse trees.


CHECK_ONLY

public static final JavaCompiler.CompilePolicy CHECK_ONLY
Just attribute and do flow analysis on the parse trees. This should catch most user errors.


SIMPLE

public static final JavaCompiler.CompilePolicy SIMPLE
Attribute everything, then do flow analysis for everything, then desugar everything, and only then generate output. This means no output will be generated if there are any errors in any classes.


BY_FILE

public static final JavaCompiler.CompilePolicy BY_FILE
Groups the classes for each source file together, then process each group in a manner equivalent to the SIMPLE policy. This means no output will be generated if there are any errors in any of the classes in a source file.


BY_TODO

public static final JavaCompiler.CompilePolicy BY_TODO
Completely process each entry on the todo list in turn. -- this is the same for 1.5. Means output might be generated for some classes in a compilation unit and not others.

Method Detail

values

public static final JavaCompiler.CompilePolicy[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(JavaCompiler.CompilePolicy c : JavaCompiler.CompilePolicy.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static JavaCompiler.CompilePolicy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

decode

static JavaCompiler.CompilePolicy decode(java.lang.String option)