Examples of CompilationUnit


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit

          compilerOptions,
          new DefaultProblemFactory(Locale.getDefault())),
      false);
   
    ICompilationUnit sourceUnit =
      new CompilationUnit(
        source,
        "", //$NON-NLS-1$
        compilerOptions.defaultEncoding);
    final CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
    CompilationUnitDeclaration compilationUnitDeclaration = parser.dietParse(sourceUnit, compilationResult);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit

          new DefaultProblemFactory(Locale.getDefault()));
         
    CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);

    ICompilationUnit sourceUnit =
      new CompilationUnit(
        source,
        "", //$NON-NLS-1$
        compilerOptions.defaultEncoding);

    CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit

    CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);
    parser.setMethodsFullRecovery(false);
    parser.setStatementsRecovery(enabledStatementRecovery);
   
    ICompilationUnit sourceUnit =
      new CompilationUnit(
        source,
        "", //$NON-NLS-1$
        compilerOptions.defaultEncoding);

    final CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit

    try {
      IPackageBinding packageBinding = getPackage();
      if (packageBinding != null) {
        final IJavaElement javaElement = packageBinding.getJavaElement();
        if (javaElement!= null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
          return new CompilationUnit((PackageFragment) javaElement, this.getInternalName(), this.resolver.getWorkingCopyOwner()).getWorkingCopy(this.resolver.getWorkingCopyOwner(), null);
        }
      }
    } catch (JavaModelException e) {
      //ignore
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit

   *   if the given requestor is not the same as the current working copy owner one.
   */
  public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaModelException {
    ExternalJavaProject project = new ExternalJavaProject(classpath);
    IPackageFragment parent = project.getPackageFragmentRoot(Path.EMPTY).getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);
    CompilationUnit result = new CompilationUnit((PackageFragment) parent, name, this);
    result.becomeWorkingCopy(problemRequestor, monitor);
    return result;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit

   * @since 3.3
   */
  public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProgressMonitor monitor) throws JavaModelException {
    ExternalJavaProject project = new ExternalJavaProject(classpath);
    IPackageFragment parent = project.getPackageFragmentRoot(Path.EMPTY).getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);
    CompilationUnit result = new CompilationUnit((PackageFragment) parent, name, this);
    result.becomeWorkingCopy(getProblemRequestor(result), monitor);
    return result;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.jdom.CompilationUnit

      name = documentPath.toCharArray();
    } catch(Exception e){
      // ignore
    }
    if (source == null || name == null) return; // could not retrieve document info (e.g. resource was discarded)
    CompilationUnit compilationUnit = new CompilationUnit(source, name);
    try {
      parser.parseCompilationUnit(compilationUnit, true/*full parse*/);
    } catch (Exception e) {
      if (JobManager.VERBOSE) {
        e.printStackTrace();
View Full Code Here

Examples of org.codehaus.groovy.control.CompilationUnit

  protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) throws JRException
  {
    CompilerConfiguration config = new CompilerConfiguration();
    config.setSourceEncoding(SOURCE_ENCODING);
    //config.setClasspath(classpath);
    CompilationUnit unit = new CompilationUnit(config);
   
    for (int i = 0; i < units.length; i++)
    {
      try
      {
        byte[] sourceBytes = units[i].getSourceCode().getBytes(SOURCE_ENCODING);
        unit.addSource("calculator_" + units[i].getName(), new ByteArrayInputStream(sourceBytes));
      }
      catch (UnsupportedEncodingException e)
      {
        throw new JRRuntimeException(e);
      }
    }
   
    ClassCollector collector = new ClassCollector();
    unit.setClassgenCallback(collector);
    try
    {
      unit.compile(Phases.CLASS_GENERATION);
    }
    catch (CompilationFailedException e)
    {
      throw new JRException(
        "Errors were encountered when compiling report expressions class file:\n"
View Full Code Here

Examples of org.codehaus.groovy.control.CompilationUnit

                    throw new BuildException(ioe);
                }
            }
            return new JavaAwareCompilationUnit(configuration, buildClassLoaderFor());
        } else {
            return new CompilationUnit(configuration, null, buildClassLoaderFor());
        }
    }
View Full Code Here

Examples of org.codehaus.janino.Java.CompilationUnit

  private CompilationUnit get(Class<?> c) throws IOException{
    String path = c.getName();
    path = path.replaceFirst("\\$.*", "");
    path = path.replace(".", FileUtils.separator);
    path = "/" + path + ".java";
    CompilationUnit cu = functionUnits.get(path);
    if(cu != null) return cu;

    URL u = Resources.getResource(c, path);
    InputSupplier<InputStream> supplier = Resources.newInputStreamSupplier(u);
    try(InputStream is = supplier.getInput()){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.