Package org.aspectj.weaver

Examples of org.aspectj.weaver.World.resolve()


    public void visit(HasAnnotation hasAnnotation) {
      ReflectionVar v = (ReflectionVar) hasAnnotation.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType actualVarType = world.resolve(value.getClass().getName());
      ResolvedType requiredAnnotationType = hasAnnotation.getAnnotationType().resolve(world);
      matches = actualVarType.hasAnnotation(requiredAnnotationType);
    }

  }
View Full Code Here


          superclassName = javaClass.getSuperclassName();
        }
        superclassSignature = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(superclassName)).getSignature();
      }
      World world = getResolvedTypeX().getWorld();
      supertype = world.resolve(UnresolvedType.forSignature(superclassSignature));
      superTypeReference = new WeakReference<ResolvedType>(supertype);
    }
    return supertype;
  }
View Full Code Here

          annotationTypes = new ResolvedType[annos.length];
          annotations = new AnnotationAJ[annos.length];
          for (int i = 0; i < annos.length; i++) {
            AnnotationGen annotation = annos[i];
            String typeSignature = annotation.getTypeSignature();
            ResolvedType rType = w.resolve(UnresolvedType.forSignature(typeSignature));
            if (rType == null) {
              throw new RuntimeException("Whilst unpacking annotations on '" + getResolvedTypeX().getName()
                  + "', failed to resolve type '" + typeSignature + "'");
            }
            annotationTypes[i] = rType;
View Full Code Here

    return !bcelObjectType.isInterface();
  }

  private boolean mungeNewMemberType(BcelClassWeaver classWeaver, NewMemberClassTypeMunger munger) {
    World world = classWeaver.getWorld();
    ResolvedType onType = world.resolve(munger.getTargetType());
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }
    return onType.equals(classWeaver.getLazyClassGen().getType());
  }
View Full Code Here

    ResolvedMember interMethodBody = munger.getDeclaredInterMethodBody(aspectType, world);
    ResolvedMember interMethodDispatcher = munger.getDeclaredInterMethodDispatcher(aspectType, world);
    ResolvedMember memberHoldingAnyAnnotations = interMethodDispatcher;
    LazyClassGen classGen = classWeaver.getLazyClassGen();

    ResolvedType onType = world.resolve(unMangledInterMethod.getDeclaringType(), munger.getSourceLocation());
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }

    // Simple checks, can't ITD on annotations or enums
View Full Code Here

      return false;
    }

    ResolvedMember introduced = munger.getSignature();

    ResolvedType fromType = world.resolve(introduced.getDeclaringType(), munger.getSourceLocation());
    if (fromType.isRawType()) {
      fromType = fromType.getGenericType();
    }

    boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType);
View Full Code Here

    public void visit(Instanceof i) {
      ReflectionVar v = (ReflectionVar) i.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject,targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType desiredType = i.getType().resolve(world);
      ResolvedType actualType = world.resolve(value.getClass().getName());
      matches = desiredType.isAssignableFrom(actualType);
    }
   
    public void visit(MatchingContextBasedTest matchingContextTest) {
      matches = matchingContextTest.matches(this.matchContext);
View Full Code Here

    public void visit(HasAnnotation hasAnnotation) {
      ReflectionVar v = (ReflectionVar) hasAnnotation.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject,targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType actualVarType = world.resolve(value.getClass().getName());
      ResolvedType requiredAnnotationType = hasAnnotation.getAnnotationType().resolve(world);
      matches = actualVarType.hasAnnotation(requiredAnnotationType);
    }
   
  }
View Full Code Here

      // return type for the specific declaration at the shadow. (FastCar Sub.getCar())
      // XXX Put out another XLINT in this case?
      return;
    }
    // PR60015 - Don't report the warning if the declaring type is object and 'this' is an interface
    if (exactDeclaringType.resolve(world).isInterface() && shadowDeclaringType.equals(world.resolve("java.lang.Object"))) {
      return;
    }

    SignaturePattern nonConfusingPattern =
      new SignaturePattern(
View Full Code Here

    World world = concreteAspect.getWorld();
    ResolvedType runtimeException = world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION);
    ResolvedType error = world.getCoreType(UnresolvedType.ERROR);
   
    for (int i=0, len=excs.length; i < len; i++) {
      ResolvedType t = world.resolve(excs[i],true);
            if (t.isMissing()) {
                world.getLint().cantFindType.signal(
                    WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE,excs[i].getName()),
                    getSourceLocation()
                    );
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.