Examples of ReferenceType


Examples of org.aspectj.weaver.ReferenceType

        sourceType.sourceName);

    // Get the annotation specified in the declare
    UnresolvedType aspectType = decA.getAspect();
    if (aspectType instanceof ReferenceType) {
      ReferenceType rt = (ReferenceType) aspectType;
      if (rt.isParameterizedType() || rt.isRawType()) {
        aspectType = rt.getGenericType();
      }
    }
    TypeBinding tb = factory.makeTypeBinding(aspectType);

    // Hideousness follows:
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

    }
    return true;
  }

  private Annotation[] retrieveAnnotationFromBinaryTypeBinding(DeclareAnnotation decA, ReferenceBinding declaringBinding) {
    ReferenceType rt = (ReferenceType) factory.fromEclipse(declaringBinding);
    ResolvedMember[] methods = rt.getDeclaredMethods();
    ResolvedMember decaMethod = null;
    String nameToLookFor = decA.getAnnotationMethod();
    for (int i = 0; i < methods.length; i++) {
      if (methods[i].getName().equals(nameToLookFor)) {
        decaMethod = methods[i];
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

    }

    // also add it to the bcel delegate if there is one
    if (sourceType instanceof BinaryTypeBinding) {
      ResolvedType onType = factory.fromEclipse(sourceType);
      ReferenceType rt = (ReferenceType) onType;
      ReferenceTypeDelegate rtd = rt.getDelegate();
      if (rtd instanceof BcelObjectType) {
        rt.addParent(parent);
        // ((BcelObjectType) rtd).addParent(parent);
      }
    }

  }
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

          + formalBinding.getType() + "' is not (compiler limitation)");
    }
    bindingPattern = true;

    // Check that the formal is bound to a type that is represented by one field in the annotation type
    ReferenceType theAnnotationType = (ReferenceType) annotationType;
    ResolvedMember[] annotationFields = theAnnotationType.getDeclaredMethods();
    field = null;
    for (int i = 0; i < annotationFields.length; i++) {
      ResolvedMember resolvedMember = annotationFields[i];
      if (resolvedMember.getReturnType().equals(formalBinding.getType())) {
        if (field != null) {
          scope.message(IMessage.ERROR, this, "The field type '" + formalBinding.getType()
              + "' is ambiguous for annotation type '" + theAnnotationType.getName() + "'");
        }
        field = resolvedMember;
      }
    }
    if (field == null) {
      scope.message(IMessage.ERROR, this, "No field of type '" + formalBinding.getType() + "' exists on annotation type '"
          + theAnnotationType.getName() + "'");
    }

    BindingAnnotationFieldTypePattern binding = new BindingAnnotationFieldTypePattern(formalBinding.getType(), formalBinding
        .getIndex(), theAnnotationType);
    binding.copyLocationFrom(this);
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

      }
    } else {
      simpleTx = UnresolvedType.forName(getName(binding));
    }

    ReferenceType name = getWorld().lookupOrCreateName(simpleTx);

    // A type can change from simple > generic > simple across a set of compiles. We need
    // to ensure the entry in the typemap is promoted and demoted correctly. The call
    // to setGenericType() below promotes a simple to a raw. This call demotes it back
    // to simple
    // pr125405
    if (!binding.isRawType() && !binding.isGenericType() && name.getTypekind() == TypeKind.RAW) {
      name.demoteToSimpleType();
    }

    EclipseSourceType t = new EclipseSourceType(name, this, binding, decl, unit);

    // For generics, go a bit further - build a typex for the generic type
    // give it the same delegate and link it to the raw type
    if (binding.isGenericType()) {
      UnresolvedType complexTx = fromBinding(binding); // fully aware of any generics info
      ResolvedType cName = world.resolve(complexTx, true);
      ReferenceType complexName = null;
      if (!cName.isMissing()) {
        complexName = (ReferenceType) cName;
        complexName = (ReferenceType) complexName.getGenericType();
        if (complexName == null) {
          complexName = new ReferenceType(complexTx, world);
        }
      } else {
        complexName = new ReferenceType(complexTx, world);
      }
      name.setGenericType(complexName);
      complexName.setDelegate(t);
    }

    name.setDelegate(t);
    if (decl instanceof AspectDeclaration) {
      ((AspectDeclaration) decl).typeX = name;
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

      }
      return annoAJs;
    } else {
      UnresolvedType declaringType = this.getDeclaringType();
      if (declaringType instanceof ReferenceType) {
        ReferenceType referenceDeclaringType = (ReferenceType) declaringType;
        if (referenceDeclaringType.getDelegate() instanceof BcelObjectType) {
          // worth a look!
          ResolvedMember field = ((ResolvedType) declaringType).lookupField(this);
          if (field != null) {
            return field.getAnnotations();
          }
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

        }
      }
    } else {
      UnresolvedType declaringType = this.getDeclaringType();
      if (declaringType instanceof ReferenceType) {
        ReferenceType referenceDeclaringType = (ReferenceType) declaringType;
        if (referenceDeclaringType.getDelegate() instanceof BcelObjectType) {
          // worth a look!
          ResolvedMember field = ((ResolvedType) declaringType).lookupField(this);
          if (field != null) {
            return field.getAnnotationOfType(ofType);
          }
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

      } else {
        // annotations may be accessible through the declaringClass if there is a bcel object behind it...
        cachedAnnotationTypes = ResolvedType.EMPTY_RESOLVED_TYPE_ARRAY;
        UnresolvedType declaringType = this.getDeclaringType();
        if (declaringType instanceof ReferenceType) {
          ReferenceType referenceDeclaringType = (ReferenceType) declaringType;
          if (referenceDeclaringType.getDelegate() instanceof BcelObjectType) {
            // worth a look!
            if (this.getKind() == Member.METHOD) {
              ResolvedMember method = ((ResolvedType) declaringType).lookupMethod(this);
              if (method != null) {
                cachedAnnotationTypes = method.getAnnotationTypes();
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

        }
      }

      if (annotated.hasAnnotation(annotationType)) {
        if (annotationType instanceof ReferenceType) {
          ReferenceType rt = (ReferenceType) annotationType;
          if (rt.getRetentionPolicy() != null && rt.getRetentionPolicy().equals("SOURCE")) {
            rt.getWorld().getMessageHandler().handleMessage(
                MessageUtil.warn(WeaverMessages.format(WeaverMessages.NO_MATCH_BECAUSE_SOURCE_RETENTION,
                    annotationType, annotated), getSourceLocation()));
            return FuzzyBoolean.NO;
          }
        }
View Full Code Here

Examples of org.aspectj.weaver.ReferenceType

            // System.out.println("? addJarFile() filename='" + filename
            // + "'");
            UnwovenClassFile classFile = new UnwovenClassFile(new File(outDir, filename).getAbsolutePath(), bytes);

            if (filename.endsWith(".class")) {
              ReferenceType type = this.addClassFile(classFile, false);
              StringBuffer sb = new StringBuffer();
              sb.append(inFile.getAbsolutePath());
              sb.append("!");
              sb.append(entry.getName());
              type.setBinaryPath(sb.toString());
              addedClassFiles.add(classFile);
            }
            // else if (!entry.isDirectory()) {
            //
            // /* bug-44190 Copy meta-data */
 
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.