/** * Searches a type from an entry-point according to a simple name. * * @param type * Entry-point to search. * @param simpleName * Expected type name. * @return type binding. */ static TypeBinding searchTypeBinding(ReferenceBinding type, String simpleName) { if (simpleName == null || type == null) { return null; } if (type.memberTypes() != null) { for (ReferenceBinding memberType : type.memberTypes()) { if (simpleName.equals(CharOperation.charToString(memberType.sourceName()))) { return memberType; } } } return searchTypeBinding(type.superclass(), simpleName); }
boolean isSameClassOrSubclassOf(ReferenceBinding testClass, ReferenceBinding superclass) { do { if (testClass == superclass) return true; } while ((testClass = testClass.superclass()) != null); return false; }
final ReferenceBinding superclass = referenceBinding.superclass(); if (superclass != null) { referenceBindings.push(superclass);
/** * Answer true if the receiver is in the superclass hierarchy of aType * NOTE: Object.isSuperclassOf(Object) -> false */ public boolean isSuperclassOf(ReferenceBinding otherType) { while ((otherType = otherType.superclass()) != null) { if (otherType.isEquivalentTo(this)) return true; } return false; }
boolean isSameClassOrSubclassOf(ReferenceBinding testClass, ReferenceBinding superclass) { do { if (TypeBinding.equalsEquals(testClass, superclass)) return true; } while ((testClass = testClass.superclass()) != null); return false; }
boolean isSameClassOrSubclassOf(ReferenceBinding testClass, ReferenceBinding superclass) { do { if (TypeBinding.equalsEquals(testClass, superclass)) return true; } while ((testClass = testClass.superclass()) != null); return false; }
boolean isSameClassOrSubclassOf(ReferenceBinding testClass, ReferenceBinding superclass) { do { if (TypeBinding.equalsEquals(testClass, superclass)) return true; } while ((testClass = testClass.superclass()) != null); return false; }
/** * Answer true if the receiver is in the superclass hierarchy of aType * NOTE: Object.isSuperclassOf(Object) -> false */ public boolean isSuperclassOf(ReferenceBinding otherType) { while ((otherType = otherType.superclass()) != null) { if (otherType.isEquivalentTo(this)) return true; } return false; }
if (superClass != null && !(superClass.superclass() == null)) {
@Nullable @Override public PsiClass getSuperClass() { return mManager.findClass(mTypeBinding.superclass()); }
@NonNull @Override public PsiClass[] getSupers() { return mManager.findClasses(mTypeBinding.superclass(), mTypeBinding.superInterfaces()); }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType(); if (!checkAccess(scope, enclosingReceiverType)) return null; if (enclosingReceiverType.id == T_JavaLangObject) { scope.problemReporter().cannotUseSuperInJavaLangObject(this); return null; } return this.resolvedType = enclosingReceiverType.superclass(); }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType(); if (!checkAccess(scope, enclosingReceiverType)) return null; if (enclosingReceiverType.id == T_JavaLangObject) { scope.problemReporter().cannotUseSuperInJavaLangObject(this); return null; } return this.resolvedType = enclosingReceiverType.superclass(); }
public TypeBinding resolveType(BlockScope scope) { this.constant = Constant.NotAConstant; ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType(); if (!checkAccess(scope, enclosingReceiverType)) return null; if (enclosingReceiverType.id == T_JavaLangObject) { scope.problemReporter().cannotUseSuperInJavaLangObject(this); return null; } return this.resolvedType = enclosingReceiverType.superclass(); }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { A annotation = _env.getFactory().getAnnotation(getPackedAnnotationBindings(), annotationClass); if (annotation != null || this.getKind() != ElementKind.CLASS || annotationClass.getAnnotation(Inherited.class) == null) return annotation; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? null : superClass.getAnnotation(annotationClass); }
@Override public TypeMirror getSuperclass() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding superBinding = binding.superclass(); if (null == superBinding || binding.isInterface()) { return _env.getFactory().getNoType(TypeKind.NONE); } // superclass of a type must be a DeclaredType return _env.getFactory().newTypeMirror(superBinding); }
@Override public TypeMirror getSuperclass() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding superBinding = binding.superclass(); if (null == superBinding || binding.isInterface()) { return _env.getFactory().getNoType(TypeKind.NONE); } // superclass of a type must be a DeclaredType return _env.getFactory().newDeclaredType(superBinding); }
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) { A [] annotations = _env.getFactory().getAnnotationsByType(Factory.getUnpackedAnnotationBindings(getPackedAnnotationBindings()), annotationType); if (annotations.length != 0 || this.getKind() != ElementKind.CLASS || annotationType.getAnnotation(Inherited.class) == null) return annotations; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? annotations : superClass.getAnnotationsByType(annotationType); }
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) { A [] annotations = _env.getFactory().getAnnotationsByType(Factory.getUnpackedAnnotationBindings(getPackedAnnotationBindings()), annotationType); if (annotations.length != 0 || this.getKind() != ElementKind.CLASS || annotationType.getAnnotation(Inherited.class) == null) return annotations; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? annotations : superClass.getAnnotationsByType(annotationType); }
@Override public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) { A [] annotations = _env.getFactory().getAnnotationsByType(Factory.getUnpackedAnnotationBindings(getPackedAnnotationBindings()), annotationType); if (annotations.length != 0 || this.getKind() != ElementKind.CLASS || annotationType.getAnnotation(Inherited.class) == null) return annotations; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? annotations : superClass.getAnnotationsByType(annotationType); }