Package org.aspectj.weaver

Examples of org.aspectj.weaver.ResolvedType


   * annotation they were working with and this code can be enhanced to support it.
   */
  public AnnotationAJ convertEclipseAnnotation(Annotation eclipseAnnotation, World w) {
    // TODO if it is sourcevisible, we shouldn't let it through!!!!!!!!!
    // testcase!
    ResolvedType annotationType = factory.fromTypeBindingToRTX(eclipseAnnotation.type.resolvedType);
    // long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
    boolean isRuntimeVisible = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
    StandardAnnotation annotationAJ = new StandardAnnotation(annotationType, isRuntimeVisible);
    generateAnnotation(eclipseAnnotation, annotationAJ);
    return annotationAJ;
View Full Code Here


  // adapted from AspectDeclaration
  private PerClause.Kind lookupPerClauseKind(ReferenceBinding binding) {
    final PerClause.Kind kind;
    if (binding instanceof BinaryTypeBinding) {
      ResolvedType superTypeX = factory.fromEclipse(binding);
      PerClause perClause = superTypeX.getPerClause();
      // clause is null for non aspect classes since coming from BCEL
      // attributes
      if (perClause != null) {
        kind = superTypeX.getPerClause().getKind();
      } else {
        kind = null;
      }
    } else if (binding instanceof SourceTypeBinding) {
      SourceTypeBinding sourceSc = (SourceTypeBinding) binding;
View Full Code Here

    if (!jc.getClassName().equals(classname)) {
      throw new RuntimeException(jc.getClassName() + "!=" + classname);
    }
    String signature = UnresolvedType.forName(jc.getClassName()).getSignature();

    ResolvedType fromTheMap = typeMap.get(signature);

    if (fromTheMap != null && !(fromTheMap instanceof ReferenceType)) {
      // what on earth is it then? See pr 112243
      StringBuffer exceptionText = new StringBuffer();
      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;
View Full Code Here

  }

  public BcelObjectType addSourceObjectType(String classname, byte[] bytes, boolean artificial) {
    BcelObjectType ret = null;
    String signature = UnresolvedType.forName(classname).getSignature();
    ResolvedType fromTheMap = typeMap.get(signature);

    if (fromTheMap != null && !(fromTheMap instanceof ReferenceType)) {
      // what on earth is it then? See pr 112243
      StringBuffer exceptionText = new StringBuffer();
      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;
View Full Code Here

    // in Java 1.4 and after, static method call of super class within
    // subclass method appears
    // as declared by the subclass in the bytecode - but they are not
    // see #104212
    if (ii.opcode == Constants.INVOKESTATIC) {
      ResolvedType appearsDeclaredBy = resolve(declaring);
      // look for the method there
      for (Iterator<ResolvedMember> iterator = appearsDeclaredBy.getMethods(true, true); iterator.hasNext();) {
        ResolvedMember method = iterator.next();
        if (Modifier.isStatic(method.getModifiers())) {
          if (name.equals(method.getName()) && signature.equals(method.getSignature())) {
            // we found it
            declaringType = method.getDeclaringType();
View Full Code Here

   * The aim of this method is to make sure a particular type is 'ok'. Some operations on the delegate for a type modify it and
   * this method is intended to undo that... see pr85132
   */
  @Override
  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
    }
    result.ensureConsistent();
    // 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));
View Full Code Here

  public boolean hasUnsatisfiedDependency(ResolvedType aspectType) {
    if (!aspectRequiredTypesProcessed) {
      if (aspectRequiredTypes != null) {
        List<String> forRemoval = new ArrayList<String>();
        for (Map.Entry<String, String> entry : aspectRequiredTypes.entrySet()) {
          ResolvedType rt = this.resolve(UnresolvedType.forName(entry.getValue()));
          if (!rt.isMissing()) {
            forRemoval.add(entry.getKey());
          } else {
            if (!getMessageHandler().isIgnoring(IMessage.INFO)) {
              getMessageHandler().handleMessage(
                  MessageUtil.info("deactivating aspect '" + aspectType.getName() + "' as it requires type '"
                      + rt.getName() + "' which cannot be found on the classpath"));
            }
          }
        }
        for (String key : forRemoval) {
          aspectRequiredTypes.remove(key);
View Full Code Here

          completeHierarchyForType(ret);
        } finally {
          typeCompletionInProgress = false;
        }
        while (typesForCompletion.size() != 0) {
          ResolvedType rt = (ResolvedType) typesForCompletion.get(0);
          completeHierarchyForType(rt);
          typesForCompletion.remove(0);
        }
      }
    } else {
View Full Code Here

  protected ResolvedType completeNonLocalType(ResolvedType ret) {
    if (ret.isMissing()) {
      return ret; // who knows ?!?
    }
    ResolvedType toResolve = ret;
    if (ret.isParameterizedType() || ret.isGenericType()) {
      toResolve = toResolve.getGenericType();
    }
    ReferenceTypeDelegate rtd = resolveReflectionTypeDelegate((ReferenceType) toResolve, getClassLoader());
    ((ReferenceType) ret).setDelegate(rtd);
    return ret;
  }
View Full Code Here

    return true;
  }

  public void addInitializer(ConcreteTypeMunger cm) {
    NewFieldTypeMunger m = (NewFieldTypeMunger) cm.getMunger();
    ResolvedType onType = m.getSignature().getDeclaringType().resolve(world);
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }

    if (Modifier.isStatic(m.getSignature().getModifiers())) {
      addedClassInitializers.add(cm);
    } else {
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ResolvedType

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.