Class JDTBatchCompiler

java.lang.Object
org.eclipse.jdt.internal.compiler.batch.Main
spoon.support.compiler.jdt.JDTBatchCompiler
All Implemented Interfaces:
org.eclipse.jdt.internal.compiler.problem.ProblemSeverities, org.eclipse.jdt.internal.compiler.util.SuffixConstants

public class JDTBatchCompiler extends org.eclipse.jdt.internal.compiler.batch.Main
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jdt.internal.compiler.batch.Main

    org.eclipse.jdt.internal.compiler.batch.Main.Logger, org.eclipse.jdt.internal.compiler.batch.Main.ResourceBundleFactory
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.eclipse.jdt.internal.compiler.batch.CompilationUnit[]
     
    protected Set<String>
     
     

    Fields inherited from class org.eclipse.jdt.internal.compiler.batch.Main

    annotationPaths, annotationsFromClasspath, batchCompiler, bundle, bundleName, checkedClasspaths, classNames, compilerLocale, compilerOptions, compilerStats, complianceLevel, currentRepetition, DEFAULT_SIZE_CLASSPATH, destinationPath, destinationPaths, enablePreview, encodings, exportedClassFilesCounter, extraProblems, failOnWarning, filenames, globalErrorsCount, globalInfoCount, globalProblemsCount, globalTasksCount, globalWarningsCount, ignoreOptionalProblemsFromFolders, limitedModules, lineCount0, log, logger, maxProblems, maxRepetition, modNames, module, NONE, options, out, pendingErrors, proceed, proceedOnError, produceRefInfo, progress, releaseVersion, rootModules, showProgress, startTime, systemExitWhenFinished, timing, TIMING_DETAILED, TIMING_DISABLED, TIMING_ENABLED, verbose

    Fields inherited from interface org.eclipse.jdt.internal.compiler.problem.ProblemSeverities

    Abort, AbortCompilation, AbortCompilationUnit, AbortMethod, AbortType, CoreSeverityMASK, Error, Fatal, Ignore, Info, InternalError, Optional, SecondaryError, Warning

    Fields inherited from interface org.eclipse.jdt.internal.compiler.util.SuffixConstants

    EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.jdt.internal.compiler.ICompilerRequestor
     
    org.eclipse.jdt.internal.compiler.batch.CompilationUnit[]
    This method returns the compilation units that will be processed and/or compiled by JDT.
     
    org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration[]
    Calls JDT to retrieve the list of compilation unit declarations.
    void
    ignoreFile​(String filePath)
     
    void
    setCompilationUnits​(org.eclipse.jdt.internal.compiler.batch.CompilationUnit[] compilationUnits)
     

    Methods inherited from class org.eclipse.jdt.internal.compiler.batch.Main

    addExtraProblems, addNewEntry, bind, bind, bind, bind, compile, compile, compile, compile, configure, disableAll, enableAll, extractDestinationPathFromSourceFile, getHandlingPolicy, getJavaHome, getLibrariesFiles, getLibraryAccess, getProblemFactory, handleBootclasspath, handleClasspath, handleEndorseddirs, handleErrorToken, handleExtdirs, handleInfoToken, handleModulepath, handleModuleSourcepath, handleWarningToken, initialize, initialize, initialize, initializeAnnotationProcessorManager, isIgnored, loggingExtraProblems, main, outputClassFiles, performCompilation, printUsage, processPathEntries, relocalize, setDestinationPath, setLocale, setPaths, shouldIgnoreOptionalProblems, tokenize, validateClasspathOptions, validateOptions

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • jdtCompiler

      protected final JDTBasedSpoonCompiler jdtCompiler
    • compilationUnits

      protected org.eclipse.jdt.internal.compiler.batch.CompilationUnit[] compilationUnits
    • filesToBeIgnored

      protected Set<String> filesToBeIgnored
  • Constructor Details

  • Method Details

    • getCompilationUnits

      public org.eclipse.jdt.internal.compiler.batch.CompilationUnit[] getCompilationUnits()
      This method returns the compilation units that will be processed and/or compiled by JDT. Note that this method also process the CUs to associate the right module information. Warning: this method cannot be replaced by a call to its supermethod as we manage the CUs differently in Spoon. We might indeed have CUs coming from virtual files or ignored CU due to the configuration. The the CUs are created from the FileCompilerConfig.
      Overrides:
      getCompilationUnits in class org.eclipse.jdt.internal.compiler.batch.Main
    • setCompilationUnits

      public void setCompilationUnits(org.eclipse.jdt.internal.compiler.batch.CompilationUnit[] compilationUnits)
    • getBatchRequestor

      public org.eclipse.jdt.internal.compiler.ICompilerRequestor getBatchRequestor()
      Overrides:
      getBatchRequestor in class org.eclipse.jdt.internal.compiler.batch.Main
    • ignoreFile

      public void ignoreFile(String filePath)
    • getUnits

      public org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration[] getUnits()
      Calls JDT to retrieve the list of compilation unit declarations. Depends on the actual implementation of getCompilationUnits()
    • getJdtCompiler

      public JDTBasedSpoonCompiler getJdtCompiler()