Package org.aspectj.weaver

Examples of org.aspectj.weaver.TypeVariable


    if (this.typeVariables == null) {
      java.lang.reflect.TypeVariable[] tVars = this.getBaseClass().getTypeParameters();
      TypeVariable[] rTypeVariables = new TypeVariable[tVars.length];
      // basic initialization
      for (int i = 0; i < tVars.length; i++) {
        rTypeVariables[i] = new TypeVariable(tVars[i].getName());
      }
      // stash it
      this.getResolvedTypeX().getWorld().recordTypeVariablesCurrentlyBeingProcessed(getBaseClass(), rTypeVariables);
      // now fill in the details...
      for (int i = 0; i < tVars.length; i++) {
        TypeVariableReferenceType tvrt = ((TypeVariableReferenceType) typeConverter.fromType(tVars[i]));
        TypeVariable tv = tvrt.getTypeVariable();
        rTypeVariables[i].setSuperclass(tv.getSuperclass());
        rTypeVariables[i].setAdditionalInterfaceBounds(tv.getSuperInterfaces());
        rTypeVariables[i].setDeclaringElement(tv.getDeclaringElement());
        rTypeVariables[i].setDeclaringElementKind(tv.getDeclaringElementKind());
        rTypeVariables[i].setRank(tv.getRank());
      }
      this.typeVariables = rTypeVariables;
      this.getResolvedTypeX().getWorld().forgetTypeVariablesCurrentlyBeingProcessed(getBaseClass());
    }
    return this.typeVariables;
View Full Code Here


    UnresolvedType[] ifBounds = new UnresolvedType[aFormalTypeParameter.interfaceBounds.length];
    for (int i = 0; i < ifBounds.length; i++) {
      ifBounds[i] = fieldTypeSignature2TypeX(aFormalTypeParameter.interfaceBounds[i], typeParams, world,
          inProgressTypeVariableResolutions);
    }
    return new TypeVariable(aFormalTypeParameter.identifier, upperBound, ifBounds);
  }
View Full Code Here

    }
    if (typeVarBounds == null) {
      // blowing up here breaks the situation with ITDs where the type variable is mentioned in the
      // declaring type and used somewhere in the signature. Temporary change to allow it to return just a
      // 'dumb' typevariablereference.
      return new TypeVariableReferenceType(new TypeVariable(aTypeVarSig.typeVariableName), world);
      // throw new GenericSignatureFormatException("Undeclared type variable in signature: " + aTypeVarSig.typeVariableName);
    }
    if (inProgressTypeVariableResolutions.containsKey(typeVarBounds)) {
      return (ResolvedType) inProgressTypeVariableResolutions.get(typeVarBounds);
    }
View Full Code Here

      if (myType != null) {
        TypeVariable[] tVars = myType.getTypeVariables();
        if (tVars.length > 0) {
          signature.append("<");
          for (int i = 0; i < tVars.length; i++) {
            TypeVariable variable = tVars[i];
            signature.append(variable.getSignatureForAttribute());
          }
          signature.append(">");
        }
      }
      // now the supertype
View Full Code Here

    if (this.typeVariables == null) {
      java.lang.reflect.TypeVariable[] tVars = this.getBaseClass().getTypeParameters();
      this.typeVariables = new TypeVariable[tVars.length];
      // basic initialization
      for (int i = 0; i < tVars.length; i++) {
        typeVariables[i] = new TypeVariable(tVars[i].getName());
      }
      // stash it
      this.getResolvedTypeX().getWorld().recordTypeVariablesCurrentlyBeingProcessed(getBaseClass(),typeVariables);
      // now fill in the details...
      for (int i = 0; i < tVars.length; i++) {
        TypeVariableReferenceType tvrt = ((TypeVariableReferenceType) typeConverter.fromType(tVars[i]));
        TypeVariable tv = tvrt.getTypeVariable();
        typeVariables[i].setUpperBound(tv.getUpperBound());
        typeVariables[i].setAdditionalInterfaceBounds(tv.getAdditionalInterfaceBounds());
        typeVariables[i].setDeclaringElement(tv.getDeclaringElement());
        typeVariables[i].setDeclaringElementKind(tv.getDeclaringElementKind());
        typeVariables[i].setRank(tv.getRank());
        typeVariables[i].setLowerBound(tv.getLowerBound());
      }
      this.getResolvedTypeX().getWorld().forgetTypeVariablesCurrentlyBeingProcessed(getBaseClass());
    }   
    return this.typeVariables;
  }
View Full Code Here

    } else if (aType instanceof java.lang.reflect.TypeVariable) {
      if (typeVariablesInProgress.get(aType)!=null) // check if we are already working on this type
        return typeVariablesInProgress.get(aType);

      java.lang.reflect.TypeVariable tv = (java.lang.reflect.TypeVariable) aType;
      TypeVariable rt_tv = new TypeVariable(tv.getName());
      TypeVariableReferenceType tvrt = new TypeVariableReferenceType(rt_tv,getWorld());
     
      typeVariablesInProgress.put(aType,tvrt); // record what we are working on, for recursion case
     
      Type[] bounds = tv.getBounds();
      ResolvedType[] resBounds = fromTypes(bounds);
      ResolvedType upperBound = resBounds[0];
      ResolvedType[] additionalBounds = new ResolvedType[0];
      if (resBounds.length > 1) {
        additionalBounds = new ResolvedType[resBounds.length - 1];
        System.arraycopy(resBounds,1,additionalBounds,0,additionalBounds.length);
      }
      rt_tv.setUpperBound(upperBound);
      rt_tv.setAdditionalInterfaceBounds(additionalBounds);
     
      typeVariablesInProgress.remove(aType); // we have finished working on it
     
      return tvrt;
    } else if (aType instanceof WildcardType) {
View Full Code Here

      UnresolvedType upperBound = fieldTypeSignature2TypeX(aFormalTypeParameter.classBound,typeParams,world,inProgressTypeVariableResolutions);
      UnresolvedType[] ifBounds = new UnresolvedType[aFormalTypeParameter.interfaceBounds.length];
      for (int i = 0; i < ifBounds.length; i++) {
        ifBounds[i] = fieldTypeSignature2TypeX(aFormalTypeParameter.interfaceBounds[i], typeParams,world,inProgressTypeVariableResolutions);
      }
      return new TypeVariable(aFormalTypeParameter.identifier,upperBound,ifBounds);
  }
View Full Code Here

    }
    if (typeVarBounds == null) {
      // blowing up here breaks the situation with ITDs where the type variable is mentioned in the
      // declaring type and used somewhere in the signature.  Temporary change to allow it to return just a
      // 'dumb' typevariablereference.
      return new TypeVariableReferenceType(new TypeVariable(aTypeVarSig.typeVariableName),world);
      // throw new GenericSignatureFormatException("Undeclared type variable in signature: " + aTypeVarSig.typeVariableName);
    }
    if (inProgressTypeVariableResolutions.containsKey(typeVarBounds)) {
      return (ResolvedType) inProgressTypeVariableResolutions.get(typeVarBounds);
    }
View Full Code Here

      for (int i = 0; i < superInterfaceBindings.length; i++) {
        superinterfaces[i] = UnresolvedType.forSignature(new String(superInterfaceBindings[i].signature()));
      }
    }
    // XXX what about lower binding?
    TypeVariable tv = new TypeVariable(name,superclass,superinterfaces);
    tv.setDeclaringElement(factory.fromBinding(aTypeParameter.binding.declaringElement));
    tv.setRank(aTypeParameter.binding.rank);
    return tv;
  }
View Full Code Here

      // first, the type variables...
      TypeVariable[] tVars = myType.getTypeVariables();
      if (tVars.length>0) {
        signature.append("<");
        for (int i = 0; i < tVars.length; i++) {
          TypeVariable variable = tVars[i];
          if (i!=0) signature.append(",");
          signature.append(variable.getSignature());
        }
        signature.append(">");
      }
      // now the supertype
      String supersig = myType.getSuperclass().getSignatureForAttribute();
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.TypeVariable

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.