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

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


           */
          org.eclipse.jdt.internal.core.util.Util.log(e, "Could not retrieve declaring class"); //$NON-NLS-1$
        }
      }
    } else if (this.binding.isTypeVariable()) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      Binding declaringElement = typeVariableBinding.isCapture() ? ((CaptureBinding) typeVariableBinding).sourceType : typeVariableBinding.declaringElement;
      if (declaringElement instanceof ReferenceBinding) {
        try {
          return this.resolver.getTypeBinding((ReferenceBinding)declaringElement);
        } catch (RuntimeException e) {
          /* in case a method cannot be resolvable due to missing jars on the classpath
View Full Code Here


      case Binding.TYPE_PARAMETER :
        if (isCapture()) {
          return NO_NAME;
        }
        TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
        return new String(typeVariableBinding.sourceName);

      case Binding.PARAMETERIZED_TYPE :
        ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) this.binding;
        buffer = new StringBuffer();
View Full Code Here

      case Binding.TYPE_PARAMETER :
        if (isCapture()) {
          return NO_NAME;
        }
        TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
        return new String(typeVariableBinding.sourceName);

      case Binding.PARAMETERIZED_TYPE :
        if (this.binding.isLocalType()) {
          return NO_NAME;
View Full Code Here

      return this.prototype.getTypeBounds();
    }
    if (this.bounds != null) {
      return this.bounds;
    }
    TypeVariableBinding typeVariableBinding = null;
    if (this.binding instanceof TypeVariableBinding) {
      typeVariableBinding = (TypeVariableBinding) this.binding;
    } else if (this.binding instanceof WildcardBinding) {
      WildcardBinding wildcardBinding = (WildcardBinding) this.binding;
      typeVariableBinding = wildcardBinding.typeVariable();
    }
    if (typeVariableBinding != null) {
      ReferenceBinding varSuperclass = typeVariableBinding.superclass();
      org.eclipse.jdt.internal.compiler.lookup.TypeBinding firstClassOrArrayBound = typeVariableBinding.firstBound;
      int boundsLength = 0;
      if (firstClassOrArrayBound == null) {
        if (varSuperclass != null && varSuperclass.id != TypeIds.T_JavaLangObject) {
          firstClassOrArrayBound = varSuperclass;
          boundsLength++;
        }
      } else  {
        if (org.eclipse.jdt.internal.compiler.lookup.TypeBinding.equalsEquals(firstClassOrArrayBound, varSuperclass)) {
          boundsLength++;
        } else if (firstClassOrArrayBound.isArrayType()) { // capture of ? extends/super arrayType
          boundsLength++;
        } else {
          firstClassOrArrayBound = null;
        }
      }
      ReferenceBinding[] superinterfaces = typeVariableBinding.superInterfaces();
      int superinterfacesLength = 0;
      if (superinterfaces != null) {
        superinterfacesLength = superinterfaces.length;
        boundsLength += superinterfacesLength;
      }
View Full Code Here

        return false;
      } else {
        return !referenceBinding.isBinaryBinding();
      }
    } else if (isTypeVariable()) {
      final TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      final Binding declaringElement = typeVariableBinding.declaringElement;
      if (declaringElement instanceof MethodBinding) {
        MethodBinding methodBinding = (MethodBinding) declaringElement;
        return !methodBinding.declaringClass.isBinaryBinding();
      } else {
View Full Code Here

        if (((TypeVariableBinding)targetType).declaringElement == method)
          return false;
        if (method.isConstructor() && ((TypeVariableBinding)targetType).declaringElement == method.declaringClass)
          return false;
      } else { // for internal calls
        TypeVariableBinding typeVariable = (TypeVariableBinding) targetType;
        if (typeVariable.declaringElement instanceof MethodBinding)
          return false;
      }
    }
    return true;
View Full Code Here

      enclosingClassFile.recordInnerClasses(this.binding);
      classFile.recordInnerClasses(this.binding);
    }
    TypeVariableBinding[] typeVariables = this.binding.typeVariables();
    for (int i = 0, max = typeVariables.length; i < max; i++) {
      TypeVariableBinding typeVariableBinding = typeVariables[i];
      if ((typeVariableBinding.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
        Util.recordNestedType(classFile, typeVariableBinding);
      }
    }
    if (this.memberTypes != null) {
View Full Code Here

        // Fall-through to failure
      }
    }

    if (binding instanceof TypeVariableBinding) {
      TypeVariableBinding tvBinding = (TypeVariableBinding) binding;
      JTypeParameter typeParameter = tvMapper.get(tvBinding);
      if (typeParameter != null) {
        return typeParameter;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding

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.