public final ReferenceBinding outermostEnclosingType() { ReferenceBinding current = this; while (true) { ReferenceBinding last = current; if ((current = current.enclosingType()) == null) return last; } }
@Override public int depth() { int depth = 0; ReferenceBinding current = this; while ((current = current.enclosingType()) != null) depth++; return depth; }
public final ReferenceBinding enclosingTypeAt(int relativeDepth) { ReferenceBinding current = this; while (relativeDepth-- > 0 && current != null) current = current.enclosingType(); return current; }
static int numberOfEnclosingFields(ReferenceBinding type){ int count = 0; type = type.enclosingType(); while(type != null) { count += type.fieldCount(); type = type.enclosingType(); } return count; }
static int numberOfEnclosingFields(ReferenceBinding type){ int count = 0; type = type.enclosingType(); while(type != null) { count += type.fieldCount(); type = type.enclosingType(); } return count; }
static int numberOfEnclosingFields(ReferenceBinding type){ int count = 0; type = type.enclosingType(); while(type != null) { count += type.fieldCount(); type = type.enclosingType(); } return count; }
public ReferenceBinding[] syntheticEnclosingInstanceTypes() { if (isStatic()) return null; ReferenceBinding enclosingType = enclosingType(); if (enclosingType == null) return null; return new ReferenceBinding[] {enclosingType}; }
/** * @return the enclosingInstancesSlotSize */ public int getEnclosingInstancesSlotSize() { if (isStatic()) return 0; return enclosingType() == null ? 0 : 1; }
/** * @return the enclosingInstancesSlotSize */ public int getEnclosingInstancesSlotSize() { if (isStatic()) return 0; return enclosingType() == null ? 0 : 1; }
@Override public PsiElement getParent() { if (mTypeBinding.enclosingType() != null) { return mManager.findClass(mTypeBinding.enclosingType()); } if (mTypeBinding.fPackage != null) { return mManager.findPackage(mTypeBinding.fPackage); } return null; }
public ReferenceBinding[] syntheticEnclosingInstanceTypes() { if (isStatic()) return null; ReferenceBinding enclosingType = enclosingType(); if (enclosingType == null) return null; return new ReferenceBinding[] {enclosingType}; } public SyntheticArgumentBinding[] syntheticOuterLocalVariables() {
if (receiverType != null) { final CtTypeReference<Object> qualifiedRef = jdtTreeBuilder.getReferencesBuilder().getQualifiedTypeReference( qualifiedNameReference.tokens, receiverType, qualifiedNameReference.fieldBinding().declaringClass.enclosingType(), new JDTTreeBuilder.OnAccessListener() { @Override public boolean onAccess(char[][] tokens, int index) {
@Override public boolean isProperType(boolean admitCapture18) { ReferenceBinding outer = enclosingType(); if (outer != null && !outer.isProperType(admitCapture18)) return false; return super.isProperType(admitCapture18); }
int findCompatibleEnclosing(ReferenceBinding enclosingType, TypeBinding type, BlockScope scope) { int depth = 0; this.currentCompatibleType = enclosingType; while (this.currentCompatibleType != null && TypeBinding.notEquals(this.currentCompatibleType, type)) { depth++; this.currentCompatibleType = this.currentCompatibleType.isStatic() ? null : this.currentCompatibleType.enclosingType(); } return depth; }
public boolean isProperType(boolean admitCapture18) { ReferenceBinding outer = enclosingType(); if (outer != null && !outer.isProperType(admitCapture18)) return false; return super.isProperType(admitCapture18); }
@Override public Element getEnclosingElement() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding enclosingType = binding.enclosingType(); if (null == enclosingType) { // this is a top level type; get its package return _env.getFactory().newPackageElement(binding.fPackage); } else { return _env.getFactory().newElement(binding.enclosingType()); } }
protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) { if (!isPrototype()) throw new IllegalStateException(); ReferenceBinding currentType = this.enclosingType; do { if (!((SourceTypeBinding)currentType).checkRedundantNullnessDefaultOne(location, annotations, nullBits, useNullTypeAnnotations)) { return; } currentType = currentType.enclosingType(); } while (currentType instanceof SourceTypeBinding); super.checkRedundantNullnessDefaultRecurse(location, annotations, nullBits, useNullTypeAnnotations); }
@Override public TypeMirror getEnclosingType() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding enclosingType = binding.enclosingType(); if (enclosingType != null) { return _env.getFactory().newTypeMirror(enclosingType); } return _env.getFactory().getNoType(TypeKind.NONE); }
@Override public Name getQualifiedName() { ReferenceBinding binding = (ReferenceBinding)_binding; char[] qName; if (binding.isMemberType()) { qName = CharOperation.concatWith(binding.enclosingType().compoundName, binding.sourceName, '.'); CharOperation.replace(qName, '$', '.'); } else { qName = CharOperation.concatWith(binding.compoundName, '.'); } return new NameImpl(qName); }
@Override public Name getQualifiedName() { ReferenceBinding binding = (ReferenceBinding)_binding; char[] qName; if (binding.isMemberType()) { qName = CharOperation.concatWith(binding.enclosingType().compoundName, binding.sourceName, '.'); CharOperation.replace(qName, '$', '.'); } else { qName = CharOperation.concatWith(binding.compoundName, '.'); } return new NameImpl(qName); }