/** * Returns true if the type is parameterized, e.g. List<String> * Note that some instances of ParameterizedTypeBinding do answer false to {@link #isParameterizedType()} * in case they have no arguments, like for non-generic members of a parameterized type. * i.e. {@link #isParameterizedType()} is not equivalent to testing <code>type.kind() == Binding.PARAMETERIZED_TYPE</code> */ public final boolean isParameterizedTypeWithActualArguments() { return (kind() == Binding.PARAMETERIZED_TYPE) && ((ParameterizedTypeBinding) this).arguments != null; }
@Override public boolean isUpperbound() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : return ((WildcardBinding) this.binding).boundKind == Wildcard.EXTENDS; case Binding.INTERSECTION_TYPE : return true; } return false; }
/** * Returns true if the type is parameterized, e.g. List<String> * Note that some instances of ParameterizedTypeBinding do answer false to {@link #isParameterizedType()} * in case they have no arguments, like for non-generic members of a parameterized type. * i.e. {@link #isParameterizedType()} is not equivalent to testing <code>type.kind() == Binding.PARAMETERIZED_TYPE</code> */ public final boolean isParameterizedTypeWithActualArguments() { return (kind() == Binding.PARAMETERIZED_TYPE) && ((ParameterizedTypeBinding) this).arguments != null; }
public boolean isUpperbound() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : return ((WildcardBinding) this.binding).boundKind == Wildcard.EXTENDS; case Binding.INTERSECTION_TYPE : return true; } return false; }
/** * Returns true if the type is parameterized, e.g. List<String>. * Note that some instances of ParameterizedTypeBinding have no arguments, like for non-generic members * of a parameterized type. Use {@link #isParameterizedTypeWithActualArguments()} instead to find out. */ public final boolean isParameterizedType() { return kind() == Binding.PARAMETERIZED_TYPE; }
public int getRank() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : WildcardBinding wildcardBinding = (WildcardBinding) this.binding; return wildcardBinding.rank; default: return -1; } }
public boolean isUpperbound() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : return ((WildcardBinding) this.binding).boundKind == Wildcard.EXTENDS; case Binding.INTERSECTION_TYPE : return true; } return false; }
@Override public boolean isInterface() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isInterface(); }
public ITypeBinding getBound() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : WildcardBinding wildcardBinding = (WildcardBinding) this.binding; if (wildcardBinding.bound != null) { return this.resolver.getTypeBinding(wildcardBinding.bound); } break; } return null; }
public ITypeBinding getBound() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : WildcardBinding wildcardBinding = (WildcardBinding) this.binding; if (wildcardBinding.bound != null) { return this.resolver.getTypeBinding(wildcardBinding.bound); } break; } return null; }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public ITypeBinding getGenericTypeOfWildcardType() { switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : WildcardBinding wildcardBinding = (WildcardBinding) this.binding; if (wildcardBinding.genericType != null) { return this.resolver.getTypeBinding(wildcardBinding.genericType); } break; } return null; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
void checkAssignment(BlockScope scope, TypeBinding lhsType, TypeBinding rhsType) { FieldBinding leftField = getLastField(this.lhs); if (leftField != null && rhsType != TypeBinding.NULL && (lhsType.kind() == Binding.WILDCARD_TYPE) && ((WildcardBinding)lhsType).boundKind != Wildcard.SUPER) { scope.problemReporter().wildcardAssignment(lhsType, rhsType, this.expression); } else if (leftField != null && !leftField.isStatic() && leftField.declaringClass != null /*length pseudo field*/&& leftField.declaringClass.isRawType()) { scope.problemReporter().unsafeRawFieldAssignment(leftField, rhsType, this.lhs); } else if (rhsType.needsUncheckedConversion(lhsType)) { scope.problemReporter().unsafeTypeConversion(this.expression, rhsType, lhsType); } }
void checkAssignment(BlockScope scope, TypeBinding lhsType, TypeBinding rhsType) { FieldBinding leftField = getLastField(this.lhs); if (leftField != null && rhsType != TypeBinding.NULL && (lhsType.kind() == Binding.WILDCARD_TYPE) && ((WildcardBinding)lhsType).boundKind != Wildcard.SUPER) { scope.problemReporter().wildcardAssignment(lhsType, rhsType, this.expression); } else if (leftField != null && !leftField.isStatic() && leftField.declaringClass != null /*length pseudo field*/&& leftField.declaringClass.isRawType()) { scope.problemReporter().unsafeRawFieldAssignment(leftField, rhsType, this.lhs); } else if (rhsType.needsUncheckedConversion(lhsType)) { scope.problemReporter().unsafeTypeConversion(this.expression, rhsType, lhsType); } }
void checkAssignment(BlockScope scope, TypeBinding lhsType, TypeBinding rhsType) { FieldBinding leftField = getLastField(this.lhs); if (leftField != null && rhsType != TypeBinding.NULL && (lhsType.kind() == Binding.WILDCARD_TYPE) && ((WildcardBinding)lhsType).boundKind != Wildcard.SUPER) { scope.problemReporter().wildcardAssignment(lhsType, rhsType, this.expression); } else if (leftField != null && !leftField.isStatic() && leftField.declaringClass != null /*length pseudo field*/&& leftField.declaringClass.isRawType()) { scope.problemReporter().unsafeRawFieldAssignment(leftField, rhsType, this.lhs); } else if (rhsType.needsUncheckedConversion(lhsType)) { scope.problemReporter().unsafeTypeConversion(this.expression, rhsType, lhsType); } }