Examples of WildcardBinding


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

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

        }
        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

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

             
      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

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

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

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

  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

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

  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

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

      return get(pmb.original());
    } else if (binding instanceof ParameterizedFieldBinding) {
      ParameterizedFieldBinding pfb = (ParameterizedFieldBinding) binding;
      return get(pfb.original());
    } else if (binding instanceof WildcardBinding) {
      WildcardBinding wcb = (WildcardBinding) binding;
      return get(wcb.erasure());
    }
    JNode result = internalGet(binding);
    if (result == null) {
      InternalCompilerException ice = new InternalCompilerException(
          "Failed to get JNode");
View Full Code Here

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

      // Fall-through to failure
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding wcBinding = (WildcardBinding) binding;

      assert (wcBinding.otherBounds == null);

      BoundType boundType;
      JClassType typeBound;

      switch (wcBinding.boundKind) {
        case Wildcard.EXTENDS: {
          assert (wcBinding.bound != null);
          boundType = BoundType.EXTENDS;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.SUPER: {
          assert (wcBinding.bound != null);
          boundType = BoundType.SUPER;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.UNBOUND: {
          boundType = BoundType.UNBOUND;
          typeBound = (JClassType) resolveType(logger, wcBinding.erasure());
        }
          break;
        default:
          assert false : "WildcardBinding of unknown boundKind???";
          return null;
View Full Code Here

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

      // Fall-through to failure
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding wcBinding = (WildcardBinding) binding;

      assert (wcBinding.otherBounds == null);

      BoundType boundType;
      JClassType typeBound;

      switch (wcBinding.boundKind) {
        case Wildcard.EXTENDS: {
          assert (wcBinding.bound != null);
          boundType = BoundType.EXTENDS;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.SUPER: {
          assert (wcBinding.bound != null);
          boundType = BoundType.SUPER;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.UNBOUND: {
          boundType = BoundType.UNBOUND;
          typeBound = (JClassType) resolveType(logger, wcBinding.erasure());
        }
          break;
        default:
          assert false : "WildcardBinding of unknown boundKind???";
          return null;
View Full Code Here

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

      return get(pmb.original());
    } else if (binding instanceof ParameterizedFieldBinding) {
      ParameterizedFieldBinding pfb = (ParameterizedFieldBinding) binding;
      return get(pfb.original());
    } else if (binding instanceof WildcardBinding) {
      WildcardBinding wcb = (WildcardBinding) binding;
      return get(wcb.erasure());
    }
    JNode result = internalGet(binding);
    if (result == null) {
      InternalCompilerException ice = new InternalCompilerException(
          "Failed to get JNode");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.