|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.apt.main.Main
public class Main
This class provides a commandline interface to the apt build-time tool.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Nested Class Summary | |
|---|---|
private class |
Main.AptHiddenOption
|
private class |
Main.AptOption
|
private class |
Main.AptXOption
A nonstandard or extended (-X) option |
private class |
Main.HiddenOption
A hidden (implementor) option |
private class |
Main.Option
This class represents an option recognized by the main program |
private class |
Main.SharedOption
|
private class |
Main.XOption
A nonstandard or extended (-X) option |
| Field Summary | |
|---|---|
(package private) java.util.Set<java.lang.String> |
aggregateGenClassFileNames
List of all the generated class file names across all apt rounds. |
(package private) java.util.Set<java.io.File> |
aggregateGenFiles
List of all the generated file names across all apt rounds. |
(package private) java.util.Set<java.lang.String> |
aggregateGenSourceFileNames
List of all the generated source file names across all apt rounds. |
(package private) java.lang.ClassLoader |
aptCL
Classloader to use for finding factories. |
private static java.lang.String |
aptRB
|
(package private) java.util.List<java.lang.String> |
classFileNames
The list of class files to process |
(package private) static int |
EXIT_ABNORMAL
Result codes. |
(package private) static int |
EXIT_CMDERR
Result codes. |
(package private) static int |
EXIT_ERROR
Result codes. |
(package private) static int |
EXIT_OK
Result codes. |
(package private) static int |
EXIT_SYSERR
Result codes. |
(package private) static java.lang.String[] |
forcedOpts
For testing: enter any options you want to be set implicitly here. |
(package private) java.util.Set<java.lang.String> |
genClassFileNames
List of names of generated class files from most recent apt round. |
(package private) java.util.Set<java.lang.String> |
genSourceFileNames
List of top level names of generated source files from most recent apt round. |
private static java.lang.String |
javacRB
|
private static java.util.ResourceBundle |
messageRBapt
|
private static java.util.ResourceBundle |
messageRBjavac
|
private Options |
options
A table of all options that's passed to the JavaCompiler constructor. |
(package private) java.util.Map<java.lang.String,java.lang.String> |
origOptions
Map representing original command-line arguments. |
(package private) java.io.PrintWriter |
out
The writer to use for diagnostic output. |
(package private) java.lang.String |
ownName
The name of the compiler, for use in diagnostics. |
(package private) java.util.Set<java.lang.Class<? extends AnnotationProcessorFactory>> |
productiveFactories
Set of all factories that have provided a processor on some apt round. |
(package private) AnnotationProcessorFactory |
providedFactory
Instantiated factory to use in lieu of discovery process. |
private Main.Option[] |
recognizedOptions
|
(package private) java.util.List<java.lang.String> |
sourceFileNames
The list of source files to process |
| Constructor Summary | |
|---|---|
Main(java.lang.String name)
Construct a compiler instance. |
|
Main(java.lang.String name,
java.io.PrintWriter out)
Construct a compiler instance. |
|
| Method Summary | |
|---|---|
(package private) void |
apMessage(AnnotationProcessingError ex)
Print a message reporting an fatal error. |
(package private) void |
bugMessage(java.lang.Throwable ex)
Print a message reporting an internal error. |
int |
compile(java.lang.String[] args,
AnnotationProcessorFactory factory)
Programmatic interface for main function. |
(package private) int |
compile(java.lang.String[] args,
Context context)
Programmatic interface for main function. |
(package private) void |
error(java.lang.String key,
java.lang.Object... args)
Report a usage error. |
(package private) void |
feMessage(java.lang.Throwable ex)
Print a message reporting an fatal error. |
(package private) static java.net.URL |
fileToURL(java.io.File file)
Returns the directory or JAR file URL corresponding to the specified local file name. |
private static java.lang.String |
getLocalizedString(java.lang.String key,
java.lang.Object... args)
Find a localized string in the resource bundle. |
private static java.lang.String |
getText(java.lang.String key,
java.lang.Object... _args)
Get and format message string from resource. |
(package private) void |
help()
Print a string that explains usage. |
private static void |
initResource()
Initialize ResourceBundle. |
(package private) void |
ioMessage(java.lang.Throwable ex)
Print a message reporting an input/output error. |
(package private) static java.net.URL[] |
pathToURLs(java.lang.String path)
Utility method for converting a search path string to an array of directory and JAR file URLs. |
protected java.util.List<java.lang.String> |
processArgs(java.lang.String[] flags)
Process command line arguments: store all command line options in `options' table and return all source filenames. |
(package private) void |
resourceMessage(java.lang.Throwable ex)
Print a message reporting an out-of-resources error. |
(package private) void |
sceMessage(sun.misc.ServiceConfigurationError ex)
Print a message about sun.misc.Service problem. |
(package private) void |
warning(java.lang.String key,
java.lang.Object... args)
Report a warning. |
(package private) void |
xhelp()
Print a string that explains usage for X options. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static java.lang.String[] forcedOpts
java.lang.String ownName
java.io.PrintWriter out
AnnotationProcessorFactory providedFactory
java.util.Map<java.lang.String,java.lang.String> origOptions
java.lang.ClassLoader aptCL
static final int EXIT_OK
static final int EXIT_ERROR
static final int EXIT_CMDERR
static final int EXIT_SYSERR
static final int EXIT_ABNORMAL
private Main.Option[] recognizedOptions
private Options options
java.util.List<java.lang.String> sourceFileNames
java.util.List<java.lang.String> classFileNames
java.util.Set<java.lang.String> genSourceFileNames
java.util.Set<java.lang.String> genClassFileNames
java.util.Set<java.lang.String> aggregateGenSourceFileNames
java.util.Set<java.lang.String> aggregateGenClassFileNames
java.util.Set<java.io.File> aggregateGenFiles
java.util.Set<java.lang.Class<? extends AnnotationProcessorFactory>> productiveFactories
private static final java.lang.String javacRB
private static final java.lang.String aptRB
private static java.util.ResourceBundle messageRBjavac
private static java.util.ResourceBundle messageRBapt
| Constructor Detail |
|---|
public Main(java.lang.String name)
public Main(java.lang.String name,
java.io.PrintWriter out)
| Method Detail |
|---|
void help()
void xhelp()
void error(java.lang.String key,
java.lang.Object... args)
void warning(java.lang.String key,
java.lang.Object... args)
protected java.util.List<java.lang.String> processArgs(java.lang.String[] flags)
args - The array of command line arguments.
public int compile(java.lang.String[] args,
AnnotationProcessorFactory factory)
args - The command line parameters.
int compile(java.lang.String[] args,
Context context)
args - The command line parameters.void bugMessage(java.lang.Throwable ex)
void apMessage(AnnotationProcessingError ex)
void sceMessage(sun.misc.ServiceConfigurationError ex)
void feMessage(java.lang.Throwable ex)
void ioMessage(java.lang.Throwable ex)
void resourceMessage(java.lang.Throwable ex)
private static java.lang.String getLocalizedString(java.lang.String key,
java.lang.Object... args)
key - The key for the localized string.private static void initResource()
private static java.lang.String getText(java.lang.String key,
java.lang.Object... _args)
static java.net.URL[] pathToURLs(java.lang.String path)
path - the search path string
static java.net.URL fileToURL(java.io.File file)
file - the File object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||