Package org.aspectj.weaver

Examples of org.aspectj.weaver.UnresolvedType


      for (int i = 0; i < annos.length; i++) {
        annoAJs[i] = EclipseAnnotationConvertor.convertEclipseAnnotation(annos[i], w, eclipseFactory);
      }
      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);
View Full Code Here


    String cleanname = annotationType.getName();
    annotationType = scope.getWorld().resolve(annotationType, true);

    // We may not have found it if it is in a package, lets look it up...
    if (ResolvedType.isMissing(annotationType)) {
      UnresolvedType type = null;
      while (ResolvedType.isMissing(type = scope.lookupType(cleanname, this))) {
        int lastDot = cleanname.lastIndexOf('.');
        if (lastDot == -1) {
          break;
        }
View Full Code Here

      if (annos == null) {
        return null;
      }
      for (int i = 0; i < annos.length; i++) {
        Annotation anno = annos[i];
        UnresolvedType ut = UnresolvedType.forSignature(new String(anno.resolvedType.signature()));
        if (w.resolve(ut).equals(ofType)) {
          // Found the one
          return EclipseAnnotationConvertor.convertEclipseAnnotation(anno, w, eclipseFactory);
        }
      }
    } 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);
View Full Code Here

    return this;
  }

  @Override
  public AnnotationTypePattern parameterizeWith(Map typeVariableMap, World w) {
    UnresolvedType newAnnotationType = annotationType;
    if (annotationType.isTypeVariableReference()) {
      TypeVariableReference t = (TypeVariableReference) annotationType;
      String key = t.getTypeVariable().getName();
      if (typeVariableMap.containsKey(key)) {
        newAnnotationType = (UnresolvedType) typeVariableMap.get(key);
View Full Code Here

          }
        }
      } 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) {
View Full Code Here

    }

    List<FormalBinding> bindings = new ArrayList<FormalBinding>();
    for (int i = 0; i < argumentNames.length; i++) {
      String argumentName = argumentNames[i];
      UnresolvedType argumentType = UnresolvedType.forSignature(method.getArgumentTypes()[i].getSignature());

      // do not bind JoinPoint / StaticJoinPoint /
      // EnclosingStaticJoinPoint
      // TODO solve me : this means that the JP/SJP/ESJP cannot appear as
      // binding
View Full Code Here

  // }

  private ResolvedMember getPointcutDeclaration(ReferencePointcut rp, MethodDeclaration declaration) {
    EclipseFactory factory = ((AjLookupEnvironment) declaration.scope.environment()).factory;
    World world = factory.getWorld();
    UnresolvedType onType = rp.onType;
    if (onType == null) {
      if (declaration.binding != null) {
        Member member = factory.makeResolvedMember(declaration.binding);
        onType = member.getDeclaringType();
      } else {
        return null;
      }
    }
    ResolvedMember[] members = onType.resolve(world).getDeclaredPointcuts();
    if (members != null) {
      for (int i = 0; i < members.length; i++) {
        if (members[i].getName().equals(rp.name)) {
          return members[i];
        }
View Full Code Here

    if (trace.isTraceEnabled()) {
      trace.enter("addLibraryAspect", this, aspectName);
    }

    // 1 - resolve as is
    UnresolvedType unresolvedT = UnresolvedType.forName(aspectName);
    unresolvedT.setNeedsModifiableDelegate(true);
    ResolvedType type = world.resolve(unresolvedT, true);
    if (type.isMissing()) {
      // fallback on inner class lookup mechanism
      String fixedName = aspectName;
      int hasDot = fixedName.lastIndexOf('.');
      while (hasDot > 0) {
        // System.out.println("BcelWeaver.addLibraryAspect " +
        // fixedName);
        char[] fixedNameChars = fixedName.toCharArray();
        fixedNameChars[hasDot] = '$';
        fixedName = new String(fixedNameChars);
        hasDot = fixedName.lastIndexOf('.');
        UnresolvedType ut = UnresolvedType.forName(fixedName);
        ut.setNeedsModifiableDelegate(true);
        type = world.resolve(ut, true);
        if (!type.isMissing()) {
          break;
        }
      }
View Full Code Here

      for (Iterator i = itMungers.iterator(); i.hasNext();) {
        ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
        ResolvedMember sig = m.getSignature();
        if (sig == null)
          continue; // we aren't interested in other kinds of munger
        UnresolvedType dType = sig.getDeclaringType();
        if (dType == null)
          continue;
        ResolvedType resolvedDeclaringType = dType.resolve(factory.getWorld());
        ResolvedMember rm = AjcMemberMaker.interMethod(sig, m.getAspectType(), resolvedDeclaringType.isInterface());
        if (ResolvedType.matches(rm, possiblyErroneousRm)) {
          // match, so dont need to report a problem!
          return;
        }
View Full Code Here

          if (dec instanceof DeclareParents) {
            DeclareParents decp = (DeclareParents) dec;
            TypePattern[] newparents = decp.getParents().getTypePatterns();
            for (int i = 0; i < newparents.length; i++) {
              TypePattern pattern = newparents[i];
              UnresolvedType ut = pattern.getExactType();
              if (ut == null)
                continue;
              if (CharOperation.compareWith(typeDecl.binding.signature(), ut.getSignature().toCharArray()) == 0)
                return;
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.UnresolvedType

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.