org.aspectj.org.eclipse.jdt.internal.core
Class CompilationUnitProblemFinder

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.Compiler
      extended by org.aspectj.org.eclipse.jdt.internal.core.CompilationUnitProblemFinder
All Implemented Interfaces:
ITypeRequestor, ProblemSeverities

public class CompilationUnitProblemFinder
extends Compiler

Responsible for resolving types inside a compilation unit being reconciled, reporting the discovered problems to a given IProblemRequestor.


Field Summary
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.Compiler
annotationProcessorManager, annotationProcessorStartIndex, DEBUG, DebugRequestor, lookupEnvironment, options, out, parser, parseThreshold, problemReporter, progress, referenceBindings, remainingIterations, requestor, stats, totalUnits, unitsToProcess, useSingleThread
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities
Abort, AbortCompilation, AbortCompilationUnit, AbortMethod, AbortType, Error, Fatal, Ignore, Optional, SecondaryError, Warning
 
Constructor Summary
protected CompilationUnitProblemFinder(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions compilerOptions, ICompilerRequestor requestor, IProblemFactory problemFactory)
          Answer a new CompilationUnitVisitor using the given name environment and compiler options.
 
Method Summary
 void accept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction)
          Add additional source types
protected static CompilerOptions getCompilerOptions(java.util.Map settings, boolean creatingAST, boolean statementsRecovery)
           
protected static IErrorHandlingPolicy getHandlingPolicy()
           
protected static ICompilerRequestor getRequestor()
           
 void initializeParser()
           
static CompilationUnitDeclaration process(CompilationUnit unitElement, SourceElementParser parser, WorkingCopyOwner workingCopyOwner, java.util.HashMap problems, boolean creatingAST, int reconcileFlags, IProgressMonitor monitor)
           
static CompilationUnitDeclaration process(CompilationUnit unitElement, WorkingCopyOwner workingCopyOwner, java.util.HashMap problems, boolean creatingAST, int reconcileFlags, IProgressMonitor monitor)
           
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.Compiler
accept, accept, addCompilationUnit, beginToCompile, compile, getUnitToProcess, handleInternalException, handleInternalException, internalBeginToCompile, process, processAnnotations, reportProgress, reportWorked, reset, resolve, resolve, setBinaryTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilationUnitProblemFinder

protected CompilationUnitProblemFinder(INameEnvironment environment,
                                       IErrorHandlingPolicy policy,
                                       CompilerOptions compilerOptions,
                                       ICompilerRequestor requestor,
                                       IProblemFactory problemFactory)
Answer a new CompilationUnitVisitor 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.

Parameters:
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.
compilerOptions - The compiler options to use for the resolution.
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.
See Also:
DefaultErrorHandlingPolicies, CompilationResult
Method Detail

accept

public void accept(ISourceType[] sourceTypes,
                   PackageBinding packageBinding,
                   AccessRestriction accessRestriction)
Add additional source types

Specified by:
accept in interface ITypeRequestor
Overrides:
accept in class Compiler

getCompilerOptions

protected static CompilerOptions getCompilerOptions(java.util.Map settings,
                                                    boolean creatingAST,
                                                    boolean statementsRecovery)

getHandlingPolicy

protected static IErrorHandlingPolicy getHandlingPolicy()

getRequestor

protected static ICompilerRequestor getRequestor()

process

public static CompilationUnitDeclaration process(CompilationUnit unitElement,
                                                 SourceElementParser parser,
                                                 WorkingCopyOwner workingCopyOwner,
                                                 java.util.HashMap problems,
                                                 boolean creatingAST,
                                                 int reconcileFlags,
                                                 IProgressMonitor monitor)
                                          throws JavaModelException
Throws:
JavaModelException

process

public static CompilationUnitDeclaration process(CompilationUnit unitElement,
                                                 WorkingCopyOwner workingCopyOwner,
                                                 java.util.HashMap problems,
                                                 boolean creatingAST,
                                                 int reconcileFlags,
                                                 IProgressMonitor monitor)
                                          throws JavaModelException
Throws:
JavaModelException

initializeParser

public void initializeParser()
Overrides:
initializeParser in class Compiler