/** * Returns all subclasses (for classes) and implementations (for interfaces) of this type */ public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(getSubclasses()); for (NdTypeInterface next : getImplementations()) { result.add(next.getImplementation()); } return result; }
public NdType getImplementation() { return APPLIES_TO.get(getNd(), this.address); }
@Override public char[][] getInterfaceNames() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { List<NdTypeInterface> interfaces = type.getInterfaces(); if (interfaces.isEmpty()) { return null; } char[][] result = new char[interfaces.size()][]; for (int idx = 0; idx < interfaces.size(); idx++) { NdTypeSignature nextInterface = interfaces.get(idx).getInterface(); result[idx] = nextInterface.getRawType().getBinaryName(); } return result; } else { return null; } } }
new NdTypeInterface(getNd(), type, createTypeSignature(signatureWrapper, JavaNames.binaryNameToFieldDescriptor(interfaceSpec))); interfaceIdx++;
@Override public char[][] getInterfaceNames() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { List<NdTypeInterface> interfaces = type.getInterfaces(); if (interfaces.isEmpty()) { return null; } char[][] result = new char[interfaces.size()][]; for (int idx = 0; idx < interfaces.size(); idx++) { NdTypeSignature nextInterface = interfaces.get(idx).getInterface(); result[idx] = nextInterface.getRawType().getBinaryName(); } return result; } else { return null; } } }
new NdTypeInterface(getNd(), type, createTypeSignature(signatureWrapper, JavaNames.binaryNameToFieldDescriptor(interfaceSpec))); interfaceIdx++;
@Override public char[] getGenericSignature() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { if (!type.getFlag(NdType.FLG_GENERIC_SIGNATURE_PRESENT)) { return null; } CharArrayBuffer buffer = new CharArrayBuffer(); NdTypeParameter.getSignature(buffer, type.getTypeParameters()); NdTypeSignature superclass = type.getSuperclass(); if (superclass != null) { superclass.getSignature(buffer); } for (NdTypeInterface nextInterface : type.getInterfaces()) { nextInterface.getInterface().getSignature(buffer); } return buffer.getContents(); } else { return null; } } }
public NdType getImplementation() { return APPLIES_TO.get(getNd(), this.address); }
/** * Returns all subclasses (for classes) and implementations (for interfaces) of this type */ public List<NdType> getSubTypes() { List<NdType> result = new ArrayList<>(); result.addAll(getSubclasses()); for (NdTypeInterface next : getImplementations()) { result.add(next.getImplementation()); } return result; }
@Override public char[] getGenericSignature() { try (IReader rl = this.typeRef.lock()) { NdType type = this.typeRef.get(); if (type != null) { if (!type.getFlag(NdType.FLG_GENERIC_SIGNATURE_PRESENT)) { return null; } CharArrayBuffer buffer = new CharArrayBuffer(); NdTypeParameter.getSignature(buffer, type.getTypeParameters()); NdTypeSignature superclass = type.getSuperclass(); if (superclass != null) { superclass.getSignature(buffer); } for (NdTypeInterface nextInterface : type.getInterfaces()) { nextInterface.getInterface().getSignature(buffer); } return buffer.getContents(); } else { return null; } } }
public NdTypeSignature getInterface() { return IMPLEMENTS.get(getNd(), this.address); } }
private static HierarchyBinaryType createBinaryTypeFrom(NdType type) { char[] enclosingTypeName = null; NdTypeSignature enclosingType = type.getDeclaringType(); if (enclosingType != null) { enclosingTypeName = enclosingType.getRawType().getBinaryName(); } char[][] typeParameters = type.getTypeParameterSignatures(); NdTypeId typeId = type.getTypeId(); HierarchyBinaryType result = new HierarchyBinaryType(type.getModifiers(), typeId.getBinaryName(), type.getSourceName(), enclosingTypeName, typeParameters.length == 0 ? null : typeParameters); NdTypeSignature superClass = type.getSuperclass(); if (superClass != null) { result.recordSuperclass(superClass.getRawType().getBinaryName()); } for (NdTypeInterface interf : type.getInterfaces()) { result.recordInterface(interf.getInterface().getRawType().getBinaryName()); } return result; }
public NdTypeSignature getInterface() { return IMPLEMENTS.get(getNd(), this.address); } }
private static HierarchyBinaryType createBinaryTypeFrom(NdType type) { char[] enclosingTypeName = null; NdTypeSignature enclosingType = type.getDeclaringType(); if (enclosingType != null) { enclosingTypeName = enclosingType.getRawType().getBinaryName(); } char[][] typeParameters = type.getTypeParameterSignatures(); NdTypeId typeId = type.getTypeId(); HierarchyBinaryType result = new HierarchyBinaryType(type.getModifiers(), typeId.getBinaryName(), type.getSourceName(), enclosingTypeName, typeParameters.length == 0 ? null : typeParameters); NdTypeSignature superClass = type.getSuperclass(); if (superClass != null) { result.recordSuperclass(superClass.getRawType().getBinaryName()); } for (NdTypeInterface interf : type.getInterfaces()) { result.recordInterface(interf.getInterface().getRawType().getBinaryName()); } return result; }