Package org.aspectj.apache.bcel.generic

Examples of org.aspectj.apache.bcel.generic.ObjectType


    InstructionList il = new InstructionList();
    Type jlClass = BcelWorld.makeBcelType(UnresolvedType.JL_CLASS);
    Type jlaAnnotation = BcelWorld.makeBcelType(UnresolvedType.ANNOTATION);
    il.append(target.createLoad(fact));
    il.append(fact.createInvoke("java/lang/Object", "getClass", jlClass, new Type[] {}, Constants.INVOKEVIRTUAL));
    il.append(fact.createConstant(new ObjectType(toType.getName())));
    il.append(fact.createInvoke("java/lang/Class", "getAnnotation", jlaAnnotation, new Type[] { jlClass },
        Constants.INVOKEVIRTUAL));
    il.append(Utility.createConversion(fact, jlaAnnotation, BcelWorld.makeBcelType(toType)));
    return il;
View Full Code Here


    il.append(((BcelVar) hasAnnotation.getVar()).createLoad(fact));

    Member getClass = MemberImpl.method(UnresolvedType.OBJECT, 0, UnresolvedType.JL_CLASS, "getClass", UnresolvedType.NONE);
    il.append(Utility.createInvoke(fact, world, getClass));
    // aload annotationClass
    il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getName())));
    // int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature());
    // il.append(new LDC_W(annClassIndex));
    Member isAnnotationPresent = MemberImpl.method(UnresolvedType.JL_CLASS, 0, UnresolvedType.BOOLEAN, "isAnnotationPresent",
        new UnresolvedType[] { UnresolvedType.JL_CLASS });
    il.append(Utility.createInvoke(fact, world, isAnnotationPresent));
View Full Code Here

    InstructionList il = new InstructionList();
    Type jlClass = BcelWorld.makeBcelType(UnresolvedType.JAVA_LANG_CLASS);
    Type jlaAnnotation = BcelWorld.makeBcelType(UnresolvedType.ANNOTATION);
    il.append(target.createLoad(fact));
    il.append(fact.createInvoke("java/lang/Object", "getClass", jlClass, new Type[] {}, Constants.INVOKEVIRTUAL));
    il.append(fact.createConstant(new ObjectType(toType.getName())));
    il.append(fact.createInvoke("java/lang/Class", "getAnnotation", jlaAnnotation, new Type[] { jlClass },
        Constants.INVOKEVIRTUAL));
    il.append(Utility.createConversion(fact, jlaAnnotation, BcelWorld.makeBcelType(toType)));
    return il;
View Full Code Here

    Member getClass = MemberImpl.method(UnresolvedType.OBJECT, 0, UnresolvedType.JAVA_LANG_CLASS, "getClass",
        UnresolvedType.NONE);
    il.append(Utility.createInvoke(fact, world, getClass));
    // aload annotationClass
    il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getName())));
    // int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature());
    // il.append(new LDC_W(annClassIndex));
    Member isAnnotationPresent = MemberImpl.method(UnresolvedType.JAVA_LANG_CLASS, 0, ResolvedType.BOOLEAN,
        "isAnnotationPresent", new UnresolvedType[] { UnresolvedType.JAVA_LANG_CLASS });
    il.append(Utility.createInvoke(fact, world, isAnnotationPresent));
View Full Code Here

    Type jlClass = BcelWorld.makeBcelType(UnresolvedType.JAVA_LANG_CLASS);
    Type jlString = BcelWorld.makeBcelType(UnresolvedType.JAVA_LANG_STRING);
    Type jlClassArray = BcelWorld.makeBcelType(UnresolvedType.JAVA_LANG_CLASS_ARRAY);
    Type jlaAnnotation = BcelWorld.makeBcelType(UnresolvedType.JAVA_LANG_ANNOTATION);

    Instruction pushConstant = fact.createConstant(new ObjectType(toType.getName()));

    if (kind == Shadow.MethodCall || kind == Shadow.MethodExecution || kind == Shadow.PreInitialization
        || kind == Shadow.Initialization || kind == Shadow.ConstructorCall || kind == Shadow.ConstructorExecution
        || kind == Shadow.AdviceExecution ||
        // annotations for fieldset/fieldget when an ITD is involved are stored against a METHOD
View Full Code Here

    for (int i = 0; i < arrayEntries.length; i++) {
      il.append(InstructionFactory.createDup(1));
      il.append(fact.createConstant(Integer.valueOf(i)));
      switch (arrayEntries[i].getType()) {
      case Constants.T_ARRAY:
        il.append(fact.createConstant(new ObjectType(arrayEntries[i].getSignature()))); // FIXME should be getName() and not
        // getSignature()?
        break;
      case Constants.T_BOOLEAN:
        il.append(fact.createGetStatic("java/lang/Boolean", "TYPE", arrayElementType));
        break;
View Full Code Here

      retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[] { ResolvedType.INT });
    } else if (i instanceof MULTIANEWARRAY) {
      MULTIANEWARRAY arrayInstruction = (MULTIANEWARRAY) i;
      UnresolvedType ut = null;
      short dimensions = arrayInstruction.getDimensions();
      ObjectType ot = arrayInstruction.getLoadClassType(cpg);
      if (ot != null) {
        ut = fromBcel(ot);
        ut = UnresolvedType.makeArray(ut, dimensions);
      } else {
        Type t = arrayInstruction.getType(cpg);
View Full Code Here

    if (getType().isInterface() || shadowIsInAroundAdvice) {
      modifiers |= Modifier.PUBLIC;
    } else {
      modifiers |= Modifier.PRIVATE;
    }
    ObjectType jpType = null;
    // Did not have different static joinpoint types in 1.2
    if (world.isTargettingAspectJRuntime12()) {
      jpType = staticTjpType;
    } else {
      jpType = isEnclosingJp ? enclosingStaticTjpType : staticTjpType;
View Full Code Here

    // create the signature
    list.append(InstructionFactory.createLoad(factoryType, 0));

    String signatureMakerName = SignatureUtils.getSignatureMakerName(sig);
    ObjectType signatureType = new ObjectType(SignatureUtils.getSignatureType(sig));

    if (world.isTargettingAspectJRuntime12()) { // TAG:SUPPORTING12: We
      // didn't have optimized
      // factory methods in 1.2
      list.append(InstructionFactory.PUSH(getConstantPool(), SignatureUtils.getSignatureString(sig, shadow.getWorld())));
View Full Code Here

      clazz.addMethodGen((LazyMethodGen)i.next());
    }
  }

    void addPerSingletonField(Member field) {
      ObjectType aspectType = (ObjectType) BcelWorld.makeBcelType(field.getReturnType());
      String aspectName = field.getReturnType().getName();

    LazyMethodGen clinit = clazz.getStaticInitializer();
    InstructionList setup = new InstructionList();
    InstructionFactory fact = clazz.getFactory();
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.generic.ObjectType

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.