Package org.aspectj.weaver

Examples of org.aspectj.weaver.ISourceContext


    }
    return true;
  }

  private void removeUnnecessaryProblems(BcelMethod method, int problemLineNumber) {
    ISourceContext sourceContext = method.getSourceContext();
    if (sourceContext instanceof IEclipseSourceContext) {
      ((IEclipseSourceContext) sourceContext).removeUnnecessaryProblems(method, problemLineNumber);
    }
  }
View Full Code Here


    new BodyPrinter(out).run();
    out.println("  end " + toShortString());
  }

  private void printAspectAttributes(PrintStream out, WeaverVersionInfo weaverVersion) {
    ISourceContext context = null;
    if (enclosingClass != null && enclosingClass.getType() != null) {
      context = enclosingClass.getType().getSourceContext();
    }
    List as = Utility.readAjAttributes(getClassName(), attributes.toArray(new Attribute[] {}), context, null, weaverVersion,
        new BcelConstantPoolReader(this.enclosingClass.getConstantPool()));
View Full Code Here

    // AspectDeclaration aspectDecl = new
    // AspectDeclaration(typeDecl.compilationResult);

    try {
      if (perClause != null && !perClause.equals("")) {
        ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLoc[0]);
        Pointcut pc = new PatternParser(perClause, context).maybeParsePerClause();
        FormalBinding[] bindings = new FormalBinding[0];
        if (pc != null)
          pc.resolve(new EclipseScope(bindings, typeDecl.scope));
      }
View Full Code Here

    String pointcutExpression = getStringLiteralFor("pointcut", adviceAnn, pcLocation);
    if (pointcutExpression == null)
      pointcutExpression = getStringLiteralFor("value", adviceAnn, pcLocation);
    try {
      // +1 to give first char of pointcut string
      ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0] + 1);
      PatternParser pp = new PatternParser(pointcutExpression, context);
      Pointcut pc = pp.parsePointcut();
      pp.checkEof();
      FormalBinding[] bindings = buildFormalAdviceBindingsFrom(methodDeclaration);
      pc.resolve(new EclipseScope(bindings, methodDeclaration.scope));
View Full Code Here

    boolean noValueSupplied = true;
    boolean containsIfPcd = false;
    int[] pcLocation = new int[2];
    String pointcutExpression = getStringLiteralFor("value", ajAnnotations.pointcutAnnotation, pcLocation);
    try {
      ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0]);
      Pointcut pc = null;// abstract
      if (pointcutExpression == null || pointcutExpression.length() == 0) {
        noValueSupplied = true; // matches nothing pointcut
      } else {
        noValueSupplied = false;
View Full Code Here

    // ATAJ: set the delegate right now for @AJ pointcut, else it is done
    // too late to lookup
    // @AJ pc refs annotation in class hierarchy
    resolvedTypeX.setDelegate(this);

    ISourceContext sourceContext = resolvedTypeX.getSourceContext();
    if (sourceContext == SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) {
      sourceContext = new SourceContextImpl(this);
      setSourceContext(sourceContext);
    }
View Full Code Here

  @Override
  public ISourceLocation getSourceLocation() {
    ISourceLocation ret = super.getSourceLocation();
    if ((ret == null || ret.getLine() == 0) && hasDeclarationLineNumberInfo()) {
      // lets see if we can do better
      ISourceContext isc = getSourceContext();
      if (isc != null) {
        ret = isc.makeSourceLocation(getDeclarationLineNumber(), getDeclarationOffset());
      } else {
        ret = new SourceLocation(null, getDeclarationLineNumber());
      }
    }
    return ret;
View Full Code Here

    }
    return true;
  }

  private void removeUnnecessaryProblems(BcelMethod method, int problemLineNumber) {
    ISourceContext sourceContext = method.getSourceContext();
    if (sourceContext instanceof IEclipseSourceContext) {
      ((IEclipseSourceContext) sourceContext).removeUnnecessaryProblems(method, problemLineNumber);
    }
  }
View Full Code Here

      SimpleScope ss = new SimpleScope(getWorld(), formalBindings);
      ss.setImportedPrefixes(new String[] { "java.lang.", "java.util." });
      return ss;
    } else {
      ResolvedType inType = getWorld().resolve(inScope.getName());
      ISourceContext sourceContext = new ISourceContext() {
        public ISourceLocation makeSourceLocation(IHasPosition position) {
          return new SourceLocation(new File(""), 0);
        }

        public ISourceLocation makeSourceLocation(int line, int offset) {
View Full Code Here

    }
    if (inScope == null) {
      return new SimpleScope(getWorld(), formalBindings);
    } else {
      ResolvedType inType = getWorld().resolve(inScope.getName());
      ISourceContext sourceContext = new ISourceContext() {
        public ISourceLocation makeSourceLocation(IHasPosition position) {
          return new SourceLocation(new File(""), 0);
        }

        public ISourceLocation makeSourceLocation(int line, int offset) {
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ISourceContext

Copyright © 2018 www.massapicom. 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.