Package org.aspectj.weaver

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


    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

    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());
        // IMessage msg = new Message(
View Full Code Here

    if (thrownExceptions == null) {
      // ??? can we really lump in Around here, how does this interact with Throwable
      if (concreteAspect != null && concreteAspect.getWorld() != null && // null tests for test harness
          (getKind().isAfter() || getKind() == AdviceKind.Before || getKind() == AdviceKind.Around)) {
        World world = concreteAspect.getWorld();
        ResolvedMember m = world.resolve(signature);
        if (m == null) {
          thrownExceptions = Collections.emptyList();
        } else {
          thrownExceptions = collectCheckedExceptions(m.getExceptions());
        }
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

      World world = v.getType().getWorld();
      ResolvedType desiredType = instanceofTest.getType().resolve(world);
      if (value == null) {
        matches = false;
      } else {
        ResolvedType actualType = world.resolve(value.getClass().getName());
        matches = desiredType.isAssignableFrom(actualType);
      }
    }

    public void visit(MatchingContextBasedTest matchingContextTest) {
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

    public void visit(Instanceof instanceofTest) {
      ReflectionVar v = (ReflectionVar) instanceofTest.getVar();
      Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
      World world = v.getType().getWorld();
      ResolvedType desiredType = instanceofTest.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

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.