Package org.aspectj.weaver

Examples of org.aspectj.weaver.ReferenceType


      exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
      exceptionText.append("Signature=[" + signature + "] Found=[" + fromTheMap + "] Class=[" + fromTheMap.getClass() + "]");
      throw new BCException(exceptionText.toString());
    }

    ReferenceType nameTypeX = (ReferenceType) fromTheMap;

    if (nameTypeX == null) {
      if (jc.isGeneric() && isInJava5Mode()) {
        nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this);
        ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
        ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret
            .getDeclaredGenericSignature()), this);
        nameTypeX.setDelegate(ret);
        genericRefType.setDelegate(ret);
        nameTypeX.setGenericType(genericRefType);
        typeMap.put(signature, nameTypeX);
      } else {
        nameTypeX = new ReferenceType(signature, this);
        ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
        typeMap.put(signature, nameTypeX);
      }
    } else {
      ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
View Full Code Here


      exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
      exceptionText.append("Signature=[" + signature + "] Found=[" + fromTheMap + "] Class=[" + fromTheMap.getClass() + "]");
      throw new BCException(exceptionText.toString());
    }

    ReferenceType nameTypeX = (ReferenceType) fromTheMap;

    if (nameTypeX == null) {
      JavaClass jc = Utility.makeJavaClass(classname, bytes);
      if (jc.isGeneric() && isInJava5Mode()) {
        nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this);
        ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
        ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret
            .getDeclaredGenericSignature()), this);
        nameTypeX.setDelegate(ret);
        genericRefType.setDelegate(ret);
        nameTypeX.setGenericType(genericRefType);
        typeMap.put(signature, nameTypeX);
      } else {
        nameTypeX = new ReferenceType(signature, this);
        ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
        typeMap.put(signature, nameTypeX);
      }
    } else {
      Object o = nameTypeX.getDelegate();
View Full Code Here

        }
      }
    }
    if (isGeneric()) {
      // update resolved typex to point at generic type not raw type.
      ReferenceType genericType = (ReferenceType) this.resolvedTypeX.getGenericType();
      // genericType.setSourceContext(this.resolvedTypeX.getSourceContext());
      // Can be null if unpacking whilst building the bcel delegate (in call hierarchy from BcelWorld.addSourceObjectType()
      // line 453) - see 317139
      if (genericType != null) {
        genericType.setStartPos(this.resolvedTypeX.getStartPos());
        this.resolvedTypeX = genericType;
      }
    }
  }
View Full Code Here

        }
      }
    }
    if (isGeneric()) {
      // update resolved typex to point at generic type not raw type.
      ReferenceType genericType = (ReferenceType) this.resolvedTypeX.getGenericType();
      genericType.setSourceContext(this.resolvedTypeX.getSourceContext());
      genericType.setStartPos(this.resolvedTypeX.getStartPos());
      this.resolvedTypeX = genericType;
    }
  }
View Full Code Here

    return (ReferenceType) outer.resolve(getResolvedTypeX().getWorld());
  }
 
  private Signature.FormalTypeParameter[] getFormalTypeParametersFromOuterClass() {
    List typeParameters = new ArrayList();
    ReferenceType outer = getOuterClass();
    ReferenceTypeDelegate outerDelegate = outer.getDelegate();
    if (!(outerDelegate instanceof BcelObjectType)) {
      throw new IllegalStateException("How come we're in BcelObjectType resolving an inner type of something that is NOT a BcelObjectType??");
    }
    BcelObjectType outerObjectType = (BcelObjectType) outerDelegate;
    if (outerObjectType.isNestedClass()) {
View Full Code Here

      exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
      exceptionText.append("Signature=["+signature+"] Found=["+fromTheMap+"] Class=["+fromTheMap.getClass()+"]");
      throw new BCException(exceptionText.toString());
    }
   
    ReferenceType nameTypeX = (ReferenceType)fromTheMap;
       
        if (nameTypeX == null) {         
        if (jc.isGeneric()) {
          nameTypeX =  ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()),this);
            ret = makeBcelObjectType(nameTypeX, jc, true);
          ReferenceType genericRefType = new ReferenceType(
              UnresolvedType.forGenericTypeSignature(signature,ret.getDeclaredGenericSignature()),this);
        nameTypeX.setDelegate(ret);
          genericRefType.setDelegate(ret);
          nameTypeX.setGenericType(genericRefType);
             typeMap.put(signature, nameTypeX);
        } else {
            nameTypeX = new ReferenceType(signature, this);
              ret = makeBcelObjectType(nameTypeX, jc, true);
               typeMap.put(signature, nameTypeX);
        }
        } else {
            ret = makeBcelObjectType(nameTypeX, jc, true);
View Full Code Here

     */
  public void validateType(UnresolvedType type) {
    ResolvedType result = typeMap.get(type.getSignature());
    if (result==null) return; // We haven't heard of it yet
    if (!result.isExposedToWeaver()) return; // cant need resetting
    ReferenceType rt = (ReferenceType)result;
    rt.getDelegate().ensureDelegateConsistent();
    // If we want to rebuild it 'from scratch' then:
//    ClassParser cp = new ClassParser(new ByteArrayInputStream(newbytes),new String(cs));
//    try {
//      rt.setDelegate(makeBcelObjectType(rt,cp.parse(),true));
//    } catch (ClassFormatException e) {
View Full Code Here

  throws GenericSignatureFormatException
  {
    if (aTypeArgument.isWildcard) return UnresolvedType.SOMETHING.resolve(world);
    if (aTypeArgument.isMinus) {
      UnresolvedType bound = fieldTypeSignature2TypeX(aTypeArgument.signature, typeParams,world,inProgressTypeVariableResolutions);
      ReferenceType rBound = (ReferenceType) world.resolve(bound);
      return new BoundedReferenceType(rBound,false,world);
    } else if (aTypeArgument.isPlus) {
      UnresolvedType bound = fieldTypeSignature2TypeX(aTypeArgument.signature, typeParams,world,inProgressTypeVariableResolutions);
      ReferenceType rBound = (ReferenceType) world.resolve(bound);
      return new BoundedReferenceType(rBound,true,world);
    } else {
      return fieldTypeSignature2TypeX(aTypeArgument.signature,typeParams,world,inProgressTypeVariableResolutions);
    }
  }
View Full Code Here

  }
 
  private static void fixUpCircularDependencies(ResolvedType aTypeX, Map typeVariableResolutions) {
    if (! (aTypeX instanceof ReferenceType)) return;
   
    ReferenceType rt = (ReferenceType) aTypeX;
    TypeVariable[] typeVars = rt.getTypeVariables();
    for (int i = 0; i < typeVars.length; i++) {
      if (typeVars[i].getUpperBound() instanceof FTPHolder) {
        Signature.FormalTypeParameter key = ((FTPHolder) typeVars[i].getUpperBound()).ftpToBeSubstituted;
        typeVars[i].setUpperBound((UnresolvedType)typeVariableResolutions.get(key));
      }
View Full Code Here

      }
    }
   
    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;
        }
      }
      return FuzzyBoolean.YES;
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ReferenceType

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.