Klasse Compiler
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler
- Alle implementierten Schnittstellen:
ITypeRequestor,ProblemSeverities
- Bekannte direkte Unterklassen:
CodeSnippetCompiler,CompilationUnitProblemFinder
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungintstatic booleanstatic IDebugRequestorprotected PrintWriterintintintbooleanVon Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities
Abort, AbortCompilation, AbortCompilationUnit, AbortMethod, AbortType, CoreSeverityMASK, Error, Fatal, Ignore, Info, InternalError, Optional, SecondaryError, Warning -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCompiler(INameEnvironment environment, IErrorHandlingPolicy policy, Map<String, String> settings, ICompilerRequestor requestor, IProblemFactory problemFactory) Veraltet.this constructor is kept to preserve 3.1 and 3.2M4 compatibilityCompiler(INameEnvironment environment, IErrorHandlingPolicy policy, Map settings, ICompilerRequestor requestor, IProblemFactory problemFactory, boolean parseLiteralExpressionsAsConstants) Veraltet.this constructor is kept to preserve 3.1 and 3.2M4 compatibilityCompiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory) Answer a new compiler using the given name environment and compiler options.Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory, PrintWriter out) Veraltet.Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory, PrintWriter out, CompilationProgress progress) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaccept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) Add an additional binary typevoidaccept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) Add an additional compilation unit into the loop -> build compilation unit declarations, their bindings and record their results.voidaccept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction) Add additional source typesprotected voidaddCompilationUnit(ICompilationUnit sourceUnit, CompilationUnitDeclaration parsedUnit) protected voidprotected voidbeginToCompile(ICompilationUnit[] sourceUnits) Add the initial set of compilation units into the loop -> build compilation unit declarations, their bindings and record their results.voidcompile(ICompilationUnit[] sourceUnits) getUnitToProcess(int next) protected voidhandleInternalException(Throwable internalException, CompilationUnitDeclaration unit, CompilationResult result) protected voidhandleInternalException(AbortCompilation abortException, CompilationUnitDeclaration unit) voidprotected voidinternalBeginToCompile(ICompilationUnit[] sourceUnits, int maxUnits) Add the initial set of compilation units into the loop -> build compilation unit declarations, their bindings and record their results.voidprocess(CompilationUnitDeclaration unit, int i) Process a compilation unit already parsed and build.protected voidprotected voidprocessCompiledUnits(int startingIndex, boolean lastRound) protected voidreportProgress(String taskDecription) Checks whether the compilation has been canceled and reports the given progress to the compiler progress.protected voidreportWorked(int workIncrement, int currentUnitIndex) Checks whether the compilation has been canceled and reports the given work increment to the compiler progress.voidreset()resolve(CompilationUnitDeclaration unit, ICompilationUnit sourceUnit, boolean verifyMethods, boolean analyzeCode, boolean generateCode) Internal API used to resolve a given compilation unit.resolve(ICompilationUnit sourceUnit, boolean verifyMethods, boolean analyzeCode, boolean generateCode) Internal API used to resolve a given compilation unit.protected voidvoidsetBinaryTypes(ReferenceBinding[] binaryTypes) booleanshouldCleanup(int index) Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.internal.compiler.impl.ITypeRequestor
accept
-
Felddetails
-
parser
-
requestor
-
options
-
problemReporter
-
out
-
stats
-
progress
-
remainingIterations
public int remainingIterations -
unitsToProcess
-
totalUnits
public int totalUnits -
lookupEnvironment
-
DEBUG
public static boolean DEBUG -
parseThreshold
public int parseThreshold -
annotationProcessorManager
-
annotationProcessorStartIndex
public int annotationProcessorStartIndex -
referenceBindings
-
useSingleThread
public boolean useSingleThread -
DebugRequestor
-
-
Konstruktordetails
-
Compiler
public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, Map<String, String> settings, ICompilerRequestor requestor, IProblemFactory problemFactory) Veraltet.this constructor is kept to preserve 3.1 and 3.2M4 compatibilityAnswer a new compiler using the given name environment and compiler options. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requestor.- Parameter:
environment- org.aspectj.org.eclipse.jdt.internal.compiler.api.env.INameEnvironment Environment used by the compiler in order to resolve type and package names. The name environment implements the actual connection of the compiler to the outside world (e.g. in batch mode the name environment is performing pure file accesses, reuse previous build state or connection to repositories). Note: the name environment is responsible for implementing the actual classpath rules.policy- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy Configurable part for problem handling, allowing the compiler client to specify the rules for handling problems (stop on first error or accumulate them all) and at the same time perform some actions such as opening a dialog in UI when compiling interactively.settings- java.util.Map The settings that control the compiler behavior.requestor- org.aspectj.org.eclipse.jdt.internal.compiler.api.ICompilerRequestor Component which will receive and persist all compilation results and is intended to consume them as they are produced. Typically, in a batch compiler, it is responsible for writing out the actual .class files to the file system.problemFactory- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory Factory used inside the compiler to create problem descriptors. It allows the compiler client to supply its own representation of compilation problems in order to avoid object conversions. Note that the factory is not supposed to accumulate the created problems, the compiler will gather them all and hand them back as part of the compilation unit result.- Siehe auch:
-
Compiler
public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, Map settings, ICompilerRequestor requestor, IProblemFactory problemFactory, boolean parseLiteralExpressionsAsConstants) Veraltet.this constructor is kept to preserve 3.1 and 3.2M4 compatibilityAnswer a new compiler using the given name environment and compiler options. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requestor.- Parameter:
environment- org.aspectj.org.eclipse.jdt.internal.compiler.api.env.INameEnvironment Environment used by the compiler in order to resolve type and package names. The name environment implements the actual connection of the compiler to the outside world (e.g. in batch mode the name environment is performing pure file accesses, reuse previous build state or connection to repositories). Note: the name environment is responsible for implementing the actual classpath rules.policy- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy Configurable part for problem handling, allowing the compiler client to specify the rules for handling problems (stop on first error or accumulate them all) and at the same time perform some actions such as opening a dialog in UI when compiling interactively.settings- java.util.Map The settings that control the compiler behavior.requestor- org.aspectj.org.eclipse.jdt.internal.compiler.api.ICompilerRequestor Component which will receive and persist all compilation results and is intended to consume them as they are produced. Typically, in a batch compiler, it is responsible for writing out the actual .class files to the file system.problemFactory- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory Factory used inside the compiler to create problem descriptors. It allows the compiler client to supply its own representation of compilation problems in order to avoid object conversions. Note that the factory is not supposed to accumulate the created problems, the compiler will gather them all and hand them back as part of the compilation unit result.parseLiteralExpressionsAsConstants-booleanThis parameter is used to optimize the literals or leave them as they are in the source. If you put true, "Hello" + " world" will be converted to "Hello world".- Siehe auch:
-
Compiler
public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory) Answer a new compiler using the given name environment and compiler options. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requestor.- Parameter:
environment- org.aspectj.org.eclipse.jdt.internal.compiler.api.env.INameEnvironment Environment used by the compiler in order to resolve type and package names. The name environment implements the actual connection of the compiler to the outside world (e.g. in batch mode the name environment is performing pure file accesses, reuse previous build state or connection to repositories). Note: the name environment is responsible for implementing the actual classpath rules.policy- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy Configurable part for problem handling, allowing the compiler client to specify the rules for handling problems (stop on first error or accumulate them all) and at the same time perform some actions such as opening a dialog in UI when compiling interactively.options- org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions The options that control the compiler behavior.requestor- org.aspectj.org.eclipse.jdt.internal.compiler.api.ICompilerRequestor Component which will receive and persist all compilation results and is intended to consume them as they are produced. Typically, in a batch compiler, it is responsible for writing out the actual .class files to the file system.problemFactory- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory Factory used inside the compiler to create problem descriptors. It allows the compiler client to supply its own representation of compilation problems in order to avoid object conversions. Note that the factory is not supposed to accumulate the created problems, the compiler will gather them all and hand them back as part of the compilation unit result.- Siehe auch:
-
Compiler
public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory, PrintWriter out) Veraltet.Answer a new compiler using the given name environment and compiler options. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requestor.- Parameter:
environment- org.aspectj.org.eclipse.jdt.internal.compiler.api.env.INameEnvironment Environment used by the compiler in order to resolve type and package names. The name environment implements the actual connection of the compiler to the outside world (e.g. in batch mode the name environment is performing pure file accesses, reuse previous build state or connection to repositories). Note: the name environment is responsible for implementing the actual classpath rules.policy- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy Configurable part for problem handling, allowing the compiler client to specify the rules for handling problems (stop on first error or accumulate them all) and at the same time perform some actions such as opening a dialog in UI when compiling interactively.options- org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions The options that control the compiler behavior.requestor- org.aspectj.org.eclipse.jdt.internal.compiler.api.ICompilerRequestor Component which will receive and persist all compilation results and is intended to consume them as they are produced. Typically, in a batch compiler, it is responsible for writing out the actual .class files to the file system.problemFactory- org.aspectj.org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory Factory used inside the compiler to create problem descriptors. It allows the compiler client to supply its own representation of compilation problems in order to avoid object conversions. Note that the factory is not supposed to accumulate the created problems, the compiler will gather them all and hand them back as part of the compilation unit result.- Siehe auch:
-
Compiler
public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory, PrintWriter out, CompilationProgress progress)
-
-
Methodendetails
-
accept
public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) Add an additional binary type- Angegeben von:
acceptin SchnittstelleITypeRequestor
-
accept
Add an additional compilation unit into the loop -> build compilation unit declarations, their bindings and record their results.- Angegeben von:
acceptin SchnittstelleITypeRequestor
-
accept
public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction) Add additional source types- Angegeben von:
acceptin SchnittstelleITypeRequestor
-
addCompilationUnit
protected void addCompilationUnit(ICompilationUnit sourceUnit, CompilationUnitDeclaration parsedUnit) -
beginToCompile
Add the initial set of compilation units into the loop -> build compilation unit declarations, their bindings and record their results. -
reportProgress
Checks whether the compilation has been canceled and reports the given progress to the compiler progress. -
reportWorked
protected void reportWorked(int workIncrement, int currentUnitIndex) Checks whether the compilation has been canceled and reports the given work increment to the compiler progress. -
compile
-
backupAptProblems
protected void backupAptProblems() -
restoreAptProblems
protected void restoreAptProblems() -
processCompiledUnits
- Löst aus:
Error
-
getUnitToProcess
-
shouldCleanup
public boolean shouldCleanup(int index) -
setBinaryTypes
-
handleInternalException
protected void handleInternalException(Throwable internalException, CompilationUnitDeclaration unit, CompilationResult result) -
handleInternalException
protected void handleInternalException(AbortCompilation abortException, CompilationUnitDeclaration unit) -
initializeParser
public void initializeParser() -
internalBeginToCompile
Add the initial set of compilation units into the loop -> build compilation unit declarations, their bindings and record their results. -
process
Process a compilation unit already parsed and build. -
processAnnotations
protected void processAnnotations() -
reset
public void reset() -
resolve
public CompilationUnitDeclaration resolve(CompilationUnitDeclaration unit, ICompilationUnit sourceUnit, boolean verifyMethods, boolean analyzeCode, boolean generateCode) Internal API used to resolve a given compilation unit. Can run a subset of the compilation process -
resolve
public CompilationUnitDeclaration resolve(ICompilationUnit sourceUnit, boolean verifyMethods, boolean analyzeCode, boolean generateCode) Internal API used to resolve a given compilation unit. Can run a subset of the compilation process
-