Package org.aspectj.weaver

Examples of org.aspectj.weaver.ReferenceType


        if (dump) {
          dumpUnchanged(classFile);
        }
        return null;
      }
      ReferenceType resolvedClassType = classType.getResolvedTypeX();

      if (world.isXmlConfigured() && world.getXmlConfiguration().excludesType(resolvedClassType)) {
        if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
          world.getMessageHandler().handleMessage(
              MessageUtil.info("Type '" + resolvedClassType.getName()
                  + "' not woven due to exclusion via XML weaver exclude section"));

        }
        if (dump) {
          dumpUnchanged(classFile);
        }
        return null;
      }

      List<ShadowMunger> shadowMungers = fastMatch(shadowMungerList, resolvedClassType);
      List<ConcreteTypeMunger> typeMungers = classType.getResolvedTypeX().getInterTypeMungers();

      resolvedClassType.checkInterTypeMungers();

      // Decide if we need to do actual weaving for this class
      boolean mightNeedToWeave = shadowMungers.size() > 0 || typeMungers.size() > 0 || classType.isAspect()
          || world.getDeclareAnnotationOnMethods().size() > 0 || world.getDeclareAnnotationOnFields().size() > 0;

      // May need bridge methods if on 1.5 and something in our hierarchy is
      // affected by ITDs
      boolean mightNeedBridgeMethods = world.isInJava5Mode() && !classType.isInterface()
          && resolvedClassType.getInterTypeMungersIncludingSupers().size() > 0;

      LazyClassGen clazz = null;
      if (mightNeedToWeave || mightNeedBridgeMethods) {
        clazz = classType.getLazyClassGen();
        // System.err.println("got lazy gen: " + clazz + ", " +
View Full Code Here


      ResolvedType resolvedBound = world.resolve(bound);
      if (resolvedBound.isMissing()) {
        world.getLint().cantFindType.signal("Unable to find type (for bound): " + resolvedBound.getName(), null);
        resolvedBound = world.resolve(UnresolvedType.OBJECT);
      }
      ReferenceType rBound = (ReferenceType) resolvedBound;
      return new BoundedReferenceType(rBound, false, world);
    } else if (aTypeArgument.isPlus) {
      UnresolvedType bound = fieldTypeSignature2TypeX(aTypeArgument.signature, typeParams, world,
          inProgressTypeVariableResolutions);
      ResolvedType resolvedBound = world.resolve(bound);
      if (resolvedBound.isMissing()) {
        world.getLint().cantFindType.signal("Unable to find type (for bound): " + resolvedBound.getName(), null);
        resolvedBound = world.resolve(UnresolvedType.OBJECT);
      }
      ReferenceType rBound = (ReferenceType) resolvedBound;
      return new BoundedReferenceType(rBound, true, world);
    } else {
      return fieldTypeSignature2TypeX(aTypeArgument.signature, typeParams, world, inProgressTypeVariableResolutions);
    }
  }
View Full Code Here

    }
    if (inProgressTypeVariableResolutions.containsKey(typeVarBounds)) {
      return inProgressTypeVariableResolutions.get(typeVarBounds);
    }
    inProgressTypeVariableResolutions.put(typeVarBounds, new FTPHolder(typeVarBounds, world));
    ReferenceType ret = new TypeVariableReferenceType(formalTypeParameter2TypeVariable(typeVarBounds, typeParams, world,
        inProgressTypeVariableResolutions), world);
    inProgressTypeVariableResolutions.put(typeVarBounds, ret);
    return ret;
  }
View Full Code Here

      Map<GenericSignature.FormalTypeParameter, ReferenceType> typeVariableResolutions) {
    if (!(aTypeX instanceof ReferenceType)) {
      return;
    }

    ReferenceType rt = (ReferenceType) aTypeX;
    TypeVariable[] typeVars = rt.getTypeVariables();
    if (typeVars != null) {
      for (int i = 0; i < typeVars.length; i++) {
        if (typeVars[i].getUpperBound() instanceof FTPHolder) {
          GenericSignature.FormalTypeParameter key = ((FTPHolder) typeVars[i].getUpperBound()).ftpToBeSubstituted;
          typeVars[i].setUpperBound(typeVariableResolutions.get(key));
View Full Code Here

    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();
    if (typeVars != null) {
      for (int i = 0; i < typeVars.length; i++) {
        if (typeVars[i].getUpperBound() instanceof FTPHolder) {
          GenericSignature.FormalTypeParameter key = ((FTPHolder) typeVars[i].getUpperBound()).ftpToBeSubstituted;
          typeVars[i].setUpperBound((UnresolvedType) typeVariableResolutions.get(key));
View Full Code Here

            // 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

  /**
   * Should be addOrReplace
   */
  public ReferenceType addClassFile(UnwovenClassFile classFile, boolean fromInpath) {
    addedClasses.add(classFile);
    ReferenceType type = world.addSourceObjectType(classFile.getJavaClass(), false).getResolvedTypeX();
    if (fromInpath) {
      type.setBinaryPath(classFile.getFilename());
    }
    return type;
  }
View Full Code Here

      // "BCELWeaver: processing class from input directory "+classFile);
      StringBuffer sb = new StringBuffer();
      sb.append(inPathDir.getAbsolutePath());
      sb.append("!");
      sb.append(filename);
      ReferenceType type = this.addClassFile(ucf, false);
      type.setBinaryPath(sb.toString());
    }
    fis.close();
    return ucf;
  }
View Full Code Here

        if (dump) {
          dumpUnchanged(classFile);
        }
        return null;
      }
      ReferenceType resolvedClassType = classType.getResolvedTypeX();

      if (world.isXmlConfigured() && world.getXmlConfiguration().excludesType(resolvedClassType)) {
        if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
          world.getMessageHandler().handleMessage(
              MessageUtil.info("Type '" + resolvedClassType.getName()
                  + "' not woven due to exclusion via XML weaver exclude section"));

        }
        if (dump) {
          dumpUnchanged(classFile);
        }
        return null;
      }

      List<ShadowMunger> shadowMungers = fastMatch(shadowMungerList, resolvedClassType);
      List<ConcreteTypeMunger> typeMungers = classType.getResolvedTypeX().getInterTypeMungers();

      resolvedClassType.checkInterTypeMungers();

      // Decide if we need to do actual weaving for this class
      boolean mightNeedToWeave = shadowMungers.size() > 0 || typeMungers.size() > 0 || classType.isAspect()
          || world.getDeclareAnnotationOnMethods().size() > 0 || world.getDeclareAnnotationOnFields().size() > 0;

      // May need bridge methods if on 1.5 and something in our hierarchy is
      // affected by ITDs
      boolean mightNeedBridgeMethods = world.isInJava5Mode() && !classType.isInterface()
          && resolvedClassType.getInterTypeMungersIncludingSupers().size() > 0;

      LazyClassGen clazz = null;
      if (mightNeedToWeave || mightNeedBridgeMethods) {
        clazz = classType.getLazyClassGen();
        // System.err.println("got lazy gen: " + clazz + ", " +
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.