Package org.aspectj.weaver.ast

Examples of org.aspectj.weaver.ast.Var


   * @see org.aspectj.weaver.Shadow#getKindedAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getKindedAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (annotationVar.get(annType) == null) {
      Var v = ReflectionVar.createAtAnnotationVar(annType,this.annotationFinder);
      annotationVar.put(annType,v);
    }
    return (Var) annotationVar.get(annType);
  }
View Full Code Here


   * @see org.aspectj.weaver.Shadow#getWithinAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinAnnotationVar(annType,this.annotationFinder);
      withinAnnotationVar.put(annType,v);
    }
    return (Var) withinAnnotationVar.get(annType);
  }
View Full Code Here

   * @see org.aspectj.weaver.Shadow#getWithinCodeAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinCodeAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinCodeAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinCodeAnnotationVar(annType,this.annotationFinder);
      withinCodeAnnotationVar.put(annType,v);
    }
    return (Var) withinCodeAnnotationVar.get(annType);
  }
View Full Code Here

   * @see org.aspectj.weaver.Shadow#getKindedAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getKindedAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (annotationVar.get(annType) == null) {
      Var v = ReflectionVar.createAtAnnotationVar(annType, this.annotationFinder);
      annotationVar.put(annType, v);
    }
    return (Var) annotationVar.get(annType);
  }
View Full Code Here

   * @see org.aspectj.weaver.Shadow#getWithinAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinAnnotationVar(annType, this.annotationFinder);
      withinAnnotationVar.put(annType, v);
    }
    return (Var) withinAnnotationVar.get(annType);
  }
View Full Code Here

   * @see org.aspectj.weaver.Shadow#getWithinCodeAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinCodeAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinCodeAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinCodeAnnotationVar(annType, this.annotationFinder);
      withinCodeAnnotationVar.put(annType, v);
    }
    return (Var) withinCodeAnnotationVar.get(annType);
  }
View Full Code Here

    if (!hasThis()) {
      throw new IllegalStateException("no this");
    }
    initializeThisAnnotationVars(); // FIXME asc Why bother with this if we always return one?
    // Even if we can't find one, we have to return one as we might have this annotation at runtime
    Var v = thisAnnotationVars.get(forAnnotationType);
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getThisVar());
    }
    return v;
  }
View Full Code Here

  public Var getTargetAnnotationVar(UnresolvedType forAnnotationType) {
    if (!hasTarget()) {
      throw new IllegalStateException("no target");
    }
    initializeTargetAnnotationVars(); // FIXME asc why bother with this if we always return one?
    Var v = targetAnnotationVars.get(forAnnotationType);
    // Even if we can't find one, we have to return one as we might have this annotation at runtime
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getTargetVar());
    }
    return v;
View Full Code Here

  @Override
  public Var getArgAnnotationVar(int i, UnresolvedType forAnnotationType) {
    initializeArgAnnotationVars();

    Var v = (Var) argAnnotationVars[i].get(forAnnotationType);
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getArgVar(i));
    }
    return v;
  }
View Full Code Here

      BindingAnnotationFieldTypePattern btp = (BindingAnnotationFieldTypePattern) annotationTypePattern;
      ResolvedType formalType = btp.getFormalType().resolve(shadow.getIWorld());
      UnresolvedType annoType = btp.getAnnotationType();
      // TODO 2 need to sort out appropriate creation of the AnnotationAccessFieldVar - what happens for
      // reflective (ReflectionShadow) access to types?
      Var var = shadow.getKindedAnnotationVar(annoType);
      if (var == null) {
        throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'");
      }
      state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType));
    } else if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
      BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern;
      UnresolvedType annotationType = btp.getAnnotationType();
      Var var = shadow.getKindedAnnotationVar(annotationType);

      // At this point, var *could* be null. The only reason this could happen (if we aren't failing...)
      // is if another binding annotation designator elsewhere in the pointcut is going to expose the annotation
      // eg. (execution(* a*(..)) && @annotation(foo)) || (execution(* b*(..)) && @this(foo))
      // where sometimes @annotation will be providing the value, and sometimes
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ast.Var

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.