Package org.aspectj.org.eclipse.jdt.internal.compiler.lookup

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding


      UnresolvedType componentType = fromBinding(aBinding.leafComponentType);
      return UnresolvedType.makeArray(componentType, aBinding.dimensions);
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding eWB = (WildcardBinding) binding;
      // Repair the bound
      // e.g. If the bound for the wildcard is a typevariable, e.g. '? extends E' then
      // the type variable in the unresolvedtype will be correct only in name. In that
      // case let's set it correctly based on the one in the eclipse WildcardBinding
      UnresolvedType theBound = null;
      if (eWB.bound instanceof TypeVariableBinding) {
        theBound = fromTypeVariableBinding((TypeVariableBinding) eWB.bound);
      } else {
        theBound = fromBinding(eWB.bound);
      }
      // if (eWB.boundKind == WildCard.SUPER) {
      //
      // }
      WildcardedUnresolvedType theType = (WildcardedUnresolvedType) TypeFactory.createTypeFromSignature(CharOperation
          .charToString(eWB.genericTypeSignature()));
      // if (theType.isGenericWildcard() && theType.isSuper()) theType.setLowerBound(theBound);
      // if (theType.isGenericWildcard() && theType.isExtends()) theType.setUpperBound(theBound);
      return theType;
    }
View Full Code Here


        }
        TypeBinding[] otherBounds = null;
        // TODO 2 ought to support extra bounds for WildcardUnresolvedType
        // if (wut.getAdditionalBounds()!=null && wut.getAdditionalBounds().length!=0) otherBounds =
        // makeTypeBindings(wut.getAdditionalBounds());
        WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,
            indexOfTypeParameterBeingConverted, bound, otherBounds, boundkind);
        return wb;
      } else if (typeX instanceof BoundedReferenceType) {
        // translate from boundedreferencetype to WildcardBinding
        BoundedReferenceType brt = (BoundedReferenceType) typeX;
        // Work out 'kind' for the WildcardBinding
        int boundkind = Wildcard.UNBOUND;
        TypeBinding bound = null;
        if (brt.isExtends()) {
          boundkind = Wildcard.EXTENDS;
          bound = makeTypeBinding(brt.getUpperBound());
        } else if (brt.isSuper()) {
          boundkind = Wildcard.SUPER;
          bound = makeTypeBinding(brt.getLowerBound());
        }
        TypeBinding[] otherBounds = null;
        if (brt.getAdditionalBounds() != null && brt.getAdditionalBounds().length != 0) {
          otherBounds = makeTypeBindings(brt.getAdditionalBounds());
        }
        WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,
            indexOfTypeParameterBeingConverted, bound, otherBounds, boundkind);
        return wb;
      } else {
        throw new BCException("This type " + typeX + " (class " + typeX.getClass().getName()
            + ") should not be claiming to be a wildcard!");
View Full Code Here

             
      case Binding.WILDCARD_TYPE :
        if (!typeBinding2.isWildcard()) {
          return false;
        }
        WildcardBinding wildcardBinding = (WildcardBinding) typeBinding;
        WildcardBinding wildcardBinding2 = (WildcardBinding) typeBinding2;
        return isEqual(wildcardBinding.bound, wildcardBinding2.bound, visitedTypes)
          && wildcardBinding.boundKind == wildcardBinding2.boundKind;
       
      case Binding.TYPE_PARAMETER :
        if (!(typeBinding2.isTypeVariable())) {
View Full Code Here

  /* (non-Javadoc)
   * @see org.aspectj.org.eclipse.jdt.core.dom.ITypeBinding#getBound()
   */
  public ITypeBinding getBound() {
    if (this.binding.isWildcard()) {
      WildcardBinding wildcardBinding = (WildcardBinding) this.binding;
      if (wildcardBinding.bound != null) {
        return this.resolver.getTypeBinding(wildcardBinding.bound);
      }
    }
    return null;
View Full Code Here

  public String getName() {
    StringBuffer buffer;
    switch (this.binding.kind()) {

      case Binding.WILDCARD_TYPE :
        WildcardBinding wildcardBinding = (WildcardBinding) this.binding;
        buffer = new StringBuffer();
        buffer.append(TypeConstants.WILDCARD_NAME);
        if (wildcardBinding.bound != null) {
          switch(wildcardBinding.boundKind) {
                case Wildcard.SUPER :
View Full Code Here

  public String getQualifiedName() {
    StringBuffer buffer;
    switch (this.binding.kind()) {

      case Binding.WILDCARD_TYPE :
        WildcardBinding wildcardBinding = (WildcardBinding) this.binding;
        buffer = new StringBuffer();
        buffer.append(TypeConstants.WILDCARD_NAME);
        final ITypeBinding bound = getBound();
        if (bound != null) {
          switch(wildcardBinding.boundKind) {
View Full Code Here

      UnresolvedType componentType = fromBinding(aBinding.leafComponentType);
      return UnresolvedType.makeArray(componentType, aBinding.dimensions);
    }
   
    if (binding instanceof WildcardBinding) {
      WildcardBinding eWB = (WildcardBinding) binding;
      UnresolvedType theType = TypeFactory.createTypeFromSignature(CharOperation.charToString(eWB.genericTypeSignature()));
       
     
      // Repair the bound
      // e.g. If the bound for the wildcard is a typevariable, e.g. '? extends E' then
      // the type variable in the unresolvedtype will be correct only in name.  In that
View Full Code Here

        boundkind = Wildcard.SUPER;
        bound = makeTypeBinding(brt.getLowerBound());
      }
      TypeBinding[] otherBounds = null;
      if (brt.getAdditionalBounds()!=null && brt.getAdditionalBounds().length!=0) otherBounds = makeTypeBindings(brt.getAdditionalBounds());
      WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,indexOfTypeParameterBeingConverted,bound,otherBounds,boundkind);
      return wb;
    } else {
      return lookupBinding(typeX.getName());
    }
  }
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding

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.