public class CompilerOptions extends Object
Compiler itself. Instances of this
class are immutable and thread-safe.| Modifier and Type | Class and Description |
|---|---|
static class |
CompilerOptions.DeprecationWarnings |
| Modifier and Type | Field and Description |
|---|---|
File |
annotationBaseDirectory
Base directory of source files for generation of annotation output files.
|
File |
annotationDirectory
Directory that will contain the annotation output files.
|
CompilerOptions.DeprecationWarnings |
deprecationWarnings
Define the deprecation level for compilation: ON, OFF, or FATAL.
|
List<Formatter> |
formatters
The
Formatter that will be used to format the machine
profiles. |
int |
maxIteration
The iteration limit during the compilation to avoid infinite loops.
|
int |
maxRecursion
The call depth limit which is used to prevent infinite recursion in the
compiler.
|
int |
nthread |
File |
outputDirectory
The directory that will contain the produced machine profiles and
dependency files (if any).
|
HashResource |
rootElement |
SourceRepository |
sourceRepository |
| Constructor and Description |
|---|
CompilerOptions(Pattern debugNsInclude,
Pattern debugNsExclude,
int maxIteration,
int maxRecursion,
Set<Formatter> formatters,
File outputDirectory,
List<File> includeDirectories,
CompilerOptions.DeprecationWarnings deprecationWarnings,
File annotationDirectory,
File annotationBaseDirectory,
String rootElement,
int nthread)
Construct a CompilerOptions instance to drive a Compiler run.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDebugEnabled(String tplName)
A utility function that checks a given template name against the list of
debug include and exclude patterns.
|
static CompilerOptions |
createAnnotationOptions(File annotationDirectory,
File annotationBaseDirectory)
Create a CompilerOptions object that is appropriate for processing annotations
|
static CompilerOptions |
createCheckSyntaxOptions(CompilerOptions.DeprecationWarnings deprecationWarnings)
Create a CompilerOptions object that is appropriate for just doing a
syntax check.
|
static HashResource |
createRootElement(String rootElement) |
static CompilerOptions.DeprecationWarnings |
getDeprecationWarnings(int deprecationLevel,
boolean failOnWarn) |
static Set<Formatter> |
getFormatters(String s) |
Set<File> |
resolveFileList(List<String> objectNames,
Collection<File> tplFiles)
Resolve a list of object template names and template Files to a set of
files based on this instance's include directories.
|
String |
toString()
A verbose representation of all of the options in this instance.
|
public final int maxIteration
public final int maxRecursion
public final List<Formatter> formatters
Formatter that will be used to format the machine
profiles.public final File outputDirectory
public final CompilerOptions.DeprecationWarnings deprecationWarnings
public final SourceRepository sourceRepository
public final File annotationDirectory
public final File annotationBaseDirectory
public final HashResource rootElement
public final int nthread
public CompilerOptions(Pattern debugNsInclude, Pattern debugNsExclude, int maxIteration, int maxRecursion, Set<Formatter> formatters, File outputDirectory, List<File> includeDirectories, CompilerOptions.DeprecationWarnings deprecationWarnings, File annotationDirectory, File annotationBaseDirectory, String rootElement, int nthread) throws SyntaxException
debugNsInclude - patterns to use to turn on debugging for matching templatesdebugNsExclude - patterns to use to turn off debugging for matching templatesmaxIteration - maximum number of iterations (<=0 unlimited)maxRecursion - maximum call depth (<=0 unlimited)formatters - formats for machine configuration filesoutputDirectory - output directory for machine configuration and dependency
files (cannot be null if either writeXmlEnable or
writeDepEnabled is true)includeDirectories - list of directories to check for template files; directories
must exist and be absolutedeprecationWarnings - level for deprecation warnings (ON, OFF, or FATAL)annotationDirectory - directory that will contain annotation output filesannotationBaseDirectory - base directory of source files for annotation outputrootElement - string containing description of root element to use; if null
or empty string, this defaults to an empty dictnthread - number of threads to use for each executor queue; 0 uses number
of CPU cores on the machineSyntaxException - if the expression for the rootElement is invalidpublic static CompilerOptions.DeprecationWarnings getDeprecationWarnings(int deprecationLevel, boolean failOnWarn)
public static CompilerOptions createCheckSyntaxOptions(CompilerOptions.DeprecationWarnings deprecationWarnings)
deprecationWarnings - determine what deprecation warnings are providedpublic static CompilerOptions createAnnotationOptions(File annotationDirectory, File annotationBaseDirectory)
annotationDirectory - Output base directory that will contain the annotation xml filesannotationBaseDirectory - Base directory where template files are being looked uppublic static HashResource createRootElement(String rootElement) throws SyntaxException
SyntaxExceptionpublic Set<File> resolveFileList(List<String> objectNames, Collection<File> tplFiles)
objectNames - object template names to lookuptplFiles - template Files to processpublic boolean checkDebugEnabled(String tplName)
tplName - name of the template to checkCopyright © 2014 Quattor. All Rights Reserved.