Examples of ICompilationUnit


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

}
private int retrieveStartingPositionAfterOpeningParenthesis(int sourceStart, int sourceEnd, int numberOfParen) {
  if (this.referenceContext == null) return sourceStart;
  CompilationResult compilationResult = this.referenceContext.compilationResult();
  if (compilationResult == null) return sourceStart;
  ICompilationUnit compilationUnit = compilationResult.getCompilationUnit();
  if (compilationUnit == null) return sourceStart;
  char[] contents = compilationUnit.getContents();
  if (contents.length == 0) return sourceStart;
  if (this.positionScanner == null) {
    this.positionScanner = new Scanner(false, false, false, this.options.sourceLevel, this.options.complianceLevel, null, null, false);
  }
  this.positionScanner.setSource(contents);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

    this.localVariableTypeNames,
    this.localVariableModifiers,
    this.declaringTypeName,
    this.lineSeparator
  );
  ICompilationUnit sourceUnit = new ICompilationUnit() {
    public char[] getFileName() {
      return CharOperation.concat(className, Util.defaultJavaExtension().toCharArray());
    }
    public char[] getContents() {
      return mapper.getCUSource(EvaluationContext.this.lineSeparator);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

    this.localVariableTypeNames,
    this.localVariableModifiers,
    this.declaringTypeName,
    this.lineSeparator
  );
  ICompilationUnit sourceUnit = new ICompilationUnit() {
    public char[] getFileName() {
      return CharOperation.concat(className, Util.defaultJavaExtension().toCharArray());
    }
    public char[] getContents() {
      return mapper.getCUSource(EvaluationContext.this.lineSeparator);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

  }
  this.options.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING);
}

public String extractDestinationPathFromSourceFile(CompilationResult result) {
  ICompilationUnit compilationUnit = result.compilationUnit;
  if (compilationUnit != null) {
    char[] fileName = compilationUnit.getFileName();
    int lastIndex = CharOperation.lastIndexOf(java.io.File.separatorChar, fileName);
    if (lastIndex != -1) {
      final String outputPathName = new String(fileName, 0, lastIndex);
      final File output = new File(outputPathName);
      if (output.exists() && output.isDirectory()) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

      this.printTag(Logger.EXTRA_PROBLEMS, this.parameters, true, false);
    }

    public void startLoggingSource(CompilationResult compilationResult) {
      if ((this.tagBits & Logger.XML) != 0) {
        ICompilationUnit compilationUnit = compilationResult.compilationUnit;
        if (compilationUnit != null) {
            char[] fileName = compilationUnit.getFileName();
            File f = new File(new String(fileName));
            if (fileName != null) {
              this.parameters.put(Logger.PATH, f.getAbsolutePath());
            }
            char[][] packageName = compilationResult.packageName;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

        return endLine;
  }
   
    public String getContext() {
        if (null == context) {
            ICompilationUnit compilationUnit = result.compilationUnit;
            IProblem[] problems = result.problems;
            if ((null == compilationUnit) || (null == problems)
                || (1 != problems.length)) { // ?? which of n>1 problems?
                context = NO_CONTEXT;
            } else {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

    }
    return units;
  }

  public String extractDestinationPathFromSourceFile(CompilationResult result) {
    ICompilationUnit compilationUnit = result.compilationUnit;
    if (compilationUnit != null) {
      char[] fileName = compilationUnit.getFileName();
      int lastIndex = CharOperation.lastIndexOf(java.io.File.separatorChar, fileName);
      if (lastIndex == -1) {
        return System.getProperty("user.dir"); //$NON-NLS-1$
      }
      return new String(CharOperation.subarray(fileName, 0, lastIndex));
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

              result);
          if (containsLocalType)   parsedUnit.bits |= ASTNode.HasAllMethodBodies;
        } else {
          // create parsed unit from file
          IFile file = (IFile) cu.getResource();
          ICompilationUnit sourceUnit = this.builder.createCompilationUnitFromPath(openable, file);
         
          CompilationResult unitResult = new CompilationResult(sourceUnit, i, openablesLength, this.options.maxProblemsPerUnit);
          parsedUnit = parser.dietParse(sourceUnit, unitResult);
        }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

  } finally {
    if (monitor != null) monitor.done();
  }
}
protected ICompilationUnit createCompilationUnitFromPath(Openable handle, IFile file) {
  ICompilationUnit unit = super.createCompilationUnitFromPath(handle, file);
  this.cuToHandle.put(unit, handle);
  return unit;
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit

          int typeNameStart = qSourceFileName.length() - typeName.length;
          qPackageName =  qSourceFileName.substring(0, typeNameStart - 1);
          sourceFileName = qSourceFileName.substring(typeNameStart);
        }
      }
      ICompilationUnit workingCopy = (ICompilationUnit) this.workingCopies.get(qualifiedTypeName);
      if (workingCopy != null) {
        answer = new NameEnvironmentAnswer(workingCopy, null /*no access restriction*/);
      } else {
        answer = location.findClass(
          sourceFileName, // doesn't include the file extension
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.