Package org.aspectj.weaver.reflect

Examples of org.aspectj.weaver.reflect.ShadowMatchImpl$RuntimeTestEvaluator


    return sm;
  }

  public ShadowMatch matchesHandler(Class exceptionType, Class handlingType) {
    Shadow s = ReflectionShadow.makeHandlerShadow(world, exceptionType, handlingType, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(null);
    sm.setWithinCode(null);
    sm.setWithinType(handlingType);
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: handler match on '" + exceptionType.getName() + "' handlingType='" + handlingType
          + "' for '" + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here


    return sm;
  }

  public ShadowMatch matchesHandler(Class exceptionType, Member withinCode) {
    Shadow s = ReflectionShadow.makeHandlerShadow(world, exceptionType, withinCode, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(null);
    sm.setWithinCode(withinCode);
    sm.setWithinType(withinCode.getDeclaringClass());
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: handler match on '" + exceptionType.getName() + "' withinCode='" + withinCode
          + "' for '" + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here

    return sm;
  }

  public ShadowMatch matchesFieldGet(Field aField, Class withinType) {
    Shadow s = ReflectionShadow.makeFieldGetShadow(world, aField, withinType, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(aField);
    sm.setWithinCode(null);
    sm.setWithinType(withinType);
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: field get match on '" + aField + "' withinType='" + withinType.getName() + "' for '"
          + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here

    return sm;
  }

  public ShadowMatch matchesFieldGet(Field aField, Member withinCode) {
    Shadow s = ReflectionShadow.makeFieldGetShadow(world, aField, withinCode, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(aField);
    sm.setWithinCode(withinCode);
    sm.setWithinType(withinCode.getDeclaringClass());
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: field get match on '" + aField + "' withinCode='" + withinCode + "' for '"
          + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here

    return sm;
  }

  public ShadowMatch matchesFieldSet(Field aField, Class withinType) {
    Shadow s = ReflectionShadow.makeFieldSetShadow(world, aField, withinType, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(aField);
    sm.setWithinCode(null);
    sm.setWithinType(withinType);
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: field set match on '" + aField + "' withinType='" + withinType.getName() + "' for '"
          + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here

    return sm;
  }

  public ShadowMatch matchesFieldSet(Field aField, Member withinCode) {
    Shadow s = ReflectionShadow.makeFieldSetShadow(world, aField, withinCode, this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(aField);
    sm.setWithinCode(withinCode);
    sm.setWithinType(withinCode.getDeclaringClass());
    if (MATCH_INFO && sm.maybeMatches()) {
      System.out.println("MATCHINFO: field set match on '" + aField + "' withinCode='" + withinCode + "' for '"
          + this.expression + "': " + (sm.alwaysMatches() ? "YES" : "MAYBE"));
    }
    return sm;
  }
View Full Code Here

    Test residueTest = Literal.TRUE;
    ExposedState state = getExposedState();
    if (match.maybeTrue()) {
      residueTest = pointcut.findResidue(forShadow, state);
    }
    ShadowMatchImpl sm = new ShadowMatchImpl(match, residueTest, state, parameters);
    sm.setMatchingContext(this.matchContext);
    return sm;
  }
View Full Code Here

                fallbackExpression = null;
              }
            }
          }
          if (shadowMatch == null) {
            shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null);
          }
          else if (shadowMatch.maybeMatches() && fallbackExpression != null) {
            shadowMatch = new DefensiveShadowMatch(shadowMatch,
                fallbackExpression.matchesMethodExecution(methodToMatch));
          }
View Full Code Here

          }
          catch (ReflectionWorld.ReflectionWorldException ex) {
            // Failed to introspect target method, probably because it has been loaded
            // in a special ClassLoader. Let's try the original method instead...
            if (targetMethod == originalMethod) {
              shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null);
            }
            else {
              try {
                shadowMatch = this.pointcutExpression.matchesMethodExecution(originalMethod);
              }
              catch (ReflectionWorld.ReflectionWorldException ex2) {
                // Could neither introspect the target class nor the proxy class ->
                // let's simply consider this method as non-matching.
                shadowMatch = new ShadowMatchImpl(org.aspectj.util.FuzzyBoolean.NO, null, null, null);
              }
            }
          }
          this.shadowMatchCache.put(targetMethod, shadowMatch);
        }
View Full Code Here

    return matchesExecution(aConstructor);
  }
 
  private ShadowMatch matchesExecution(Member aMember) {
    Shadow s = ReflectionShadow.makeExecutionShadow(world, aMember,this.matchContext);
    ShadowMatchImpl sm = getShadowMatch(s);
    sm.setSubject(aMember);
    sm.setWithinCode(null);
    sm.setWithinType(aMember.getDeclaringClass());
    return sm;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.reflect.ShadowMatchImpl$RuntimeTestEvaluator

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.