Package org.aspectj.weaver

Examples of org.aspectj.weaver.Member


  }
 
  public static Shadow makeHandlerShadow(World inWorld, Class exceptionType, Class withinType, MatchingContext withContext) {
    Kind kind = Shadow.ExceptionHandler;
    Shadow enclosingShadow = makeStaticInitializationShadow(inWorld, withinType,withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createHandlerMember(exceptionType, withinType, inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createStaticInitMember(withinType, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext)
  }
View Full Code Here


  }
 
  public static Shadow makeHandlerShadow(World inWorld, Class exceptionType, java.lang.reflect.Member withinCode, MatchingContext withContext) {
    Kind kind = Shadow.ExceptionHandler;
    Shadow enclosingShadow = makeExecutionShadow(inWorld, withinCode,withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createHandlerMember(exceptionType, withinCode.getDeclaringClass(), inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createResolvedMember(withinCode, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext)
  }
View Full Code Here

    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext)
  }
 
  public static Shadow makeFieldGetShadow(World inWorld, Field forField, Class callerType, MatchingContext withContext) {
    Shadow enclosingShadow = makeStaticInitializationShadow(inWorld, callerType,withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createResolvedField(forField, inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createStaticInitMember(callerType, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    Kind kind = Shadow.FieldGet;
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }
View Full Code Here

    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }
 
  public static Shadow makeFieldGetShadow(World inWorld, Field forField, java.lang.reflect.Member inMember, MatchingContext withContext) {
    Shadow enclosingShadow = makeExecutionShadow(inWorld,inMember,withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createResolvedField(forField, inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createResolvedMember(inMember, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    Kind kind = Shadow.FieldGet;
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }
View Full Code Here

    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }

  public static Shadow makeFieldSetShadow(World inWorld, Field forField, Class callerType, MatchingContext withContext) {
    Shadow enclosingShadow = makeStaticInitializationShadow(inWorld, callerType, withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createResolvedField(forField, inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createStaticInitMember(callerType, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    Kind kind = Shadow.FieldSet;
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }
View Full Code Here

    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }

  public static Shadow makeFieldSetShadow(World inWorld, Field forField, java.lang.reflect.Member inMember, MatchingContext withContext) {
    Shadow enclosingShadow = makeExecutionShadow(inWorld,inMember,withContext);
    Member signature = ReflectionBasedReferenceTypeDelegateFactory.createResolvedField(forField, inWorld);
    ResolvedMember enclosingMember = ReflectionBasedReferenceTypeDelegateFactory.createResolvedMember(inMember, inWorld);
    ResolvedType enclosingType = enclosingMember.getDeclaringType().resolve(inWorld);
    Kind kind = Shadow.FieldSet;
    return new ReflectionShadow(inWorld,kind,signature,enclosingShadow,enclosingType,enclosingMember,withContext);
  }
View Full Code Here

      }
    }
  }

  protected static IProgramElement getNode(AsmManager model, Shadow shadow) {
    Member enclosingMember = shadow.getEnclosingCodeSignature();
    // This variant will not be tricked by ITDs that would report they are
    // in the target type already.
    // This enables us to discover the ITD declaration (in the aspect) and
    // advise it appropriately.

    // Have to be smart here, for a code node within an ITD we want to
    // lookup the declaration of the
    // ITD in the aspect in order to add the code node at the right place -
    // and not lookup the
    // ITD as it applies in some target type. Due to the use of
    // effectiveSignature we will find
    // that shadow.getEnclosingCodeSignature() will return a member
    // representing the ITD as it will
    // appear in the target type. So here, we do an extra bit of analysis to
    // make sure we
    // do the right thing in the ITD case.
    IProgramElement enclosingNode = null;
    if (shadow instanceof BcelShadow) {
      Member actualEnclosingMember = ((BcelShadow) shadow).getRealEnclosingCodeSignature();

      if (actualEnclosingMember == null) {
        enclosingNode = lookupMember(model.getHierarchy(), shadow.getEnclosingType(), enclosingMember);
      } else {
        UnresolvedType type = enclosingMember.getDeclaringType();
        UnresolvedType actualType = actualEnclosingMember.getDeclaringType();

        // if these are not the same, it is an ITD and we need to use
        // the latter to lookup
        if (type.equals(actualType)) {
          enclosingNode = lookupMember(model.getHierarchy(), shadow.getEnclosingType(), enclosingMember);
        } else {
          enclosingNode = lookupMember(model.getHierarchy(), shadow.getEnclosingType(), actualEnclosingMember);
        }
      }
    } else {
      enclosingNode = lookupMember(model.getHierarchy(), shadow.getEnclosingType(), enclosingMember);
    }

    if (enclosingNode == null) {
      Lint.Kind err = shadow.getIWorld().getLint().shadowNotInStructure;
      if (err.isEnabled()) {
        err.signal(shadow.toString(), shadow.getSourceLocation());
      }
      return null;
    }

    Member shadowSig = shadow.getSignature();
    // pr235204
    if (shadow.getKind() == Shadow.MethodCall || shadow.getKind() == Shadow.ConstructorCall
        || !shadowSig.equals(enclosingMember)) {
      IProgramElement bodyNode = findOrCreateCodeNode(model, enclosingNode, shadowSig, shadow);
      return bodyNode;
    } else {
      return enclosingNode;
    }
View Full Code Here

  // all the arguments in temps.
  public static BcelShadow makeConstructorCall(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle callHandle,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();

    Member sig = world.makeJoinPointSignatureForMethodInvocation(enclosingMethod.getEnclosingClass(),
        (InvokeInstruction) callHandle.getInstruction());

    BcelShadow s = new BcelShadow(world, ConstructorCall, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
View Full Code Here

  }

  public static BcelShadow makeArrayConstructorCall(BcelWorld world, LazyMethodGen enclosingMethod,
      InstructionHandle arrayInstruction, BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    Member sig = world.makeJoinPointSignatureForArrayConstruction(enclosingMethod.getEnclosingClass(), arrayInstruction);
    BcelShadow s = new BcelShadow(world, ConstructorCall, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, arrayInstruction), Range.genEnd(body, arrayInstruction));
    retargetAllBranches(arrayInstruction, r.getStart());
View Full Code Here

  }

  public static BcelShadow makeMonitorEnter(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle monitorInstruction,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    Member sig = world.makeJoinPointSignatureForMonitorEnter(enclosingMethod.getEnclosingClass(), monitorInstruction);
    BcelShadow s = new BcelShadow(world, SynchronizationLock, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, monitorInstruction), Range.genEnd(body, monitorInstruction));
    retargetAllBranches(monitorInstruction, r.getStart());
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.Member

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.