public class ClassLoadingReferenceTypeHierachyReader extends Object
TypeHierarchyReader that uses a given ClassLoader to locate class definitions.
Like its super class this class does not load the class nor does it provide any caching -
but it uses the specified ClassLoader in order to find the byte-code.| Modifier and Type | Class and Description |
|---|---|
static class |
TypeHierarchyReader.TypeHierarchy |
| Constructor and Description |
|---|
ClassLoadingReferenceTypeHierachyReader(ClassLoader classLoader) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCommonSuperClass(String type1,
String type2) |
org.kohsuke.asm6.Type |
getSuperClass(org.kohsuke.asm6.Type t)
Returns a
Type representing the superclass of the given
Type t. |
TypeHierarchyReader.TypeHierarchy |
hierarchyOf(org.kohsuke.asm6.Type t)
Obtains the
TypeHierarchyReader.TypeHierarchy for the given Type t. |
boolean |
isAssignableFrom(org.kohsuke.asm6.Type to,
org.kohsuke.asm6.Type from)
Determines if the
Type to is the same class, a
superclass, or superinterface of the given Type
from. |
boolean |
isInterface(org.kohsuke.asm6.Type t)
Returns true if the given
Type represents an interface. |
protected TypeHierarchyReader.TypeHierarchy |
obtainHierarchyOf(org.kohsuke.asm6.ClassReader reader) |
protected org.kohsuke.asm6.ClassReader |
reader(org.kohsuke.asm6.Type t)
Returns a
ClassReader instance which has read the class file represented by the Type t. |
public ClassLoadingReferenceTypeHierachyReader(ClassLoader classLoader)
classLoader - the ClassLoader used to locate the byte-code to parse.protected org.kohsuke.asm6.ClassReader reader(org.kohsuke.asm6.Type t)
throws IOException
ClassReader instance which has read the class file represented by the Type t.
This implementation returns a ClassReader which has been initialised with the class data located using
the classLoader provided in the constructor.IOExceptionClassReader.ClassReader(String),
ClassReader.ClassReader(InputStream)public boolean isInterface(org.kohsuke.asm6.Type t)
Type represents an interface.Class.isInterface()public org.kohsuke.asm6.Type getSuperClass(org.kohsuke.asm6.Type t)
Returns a Type representing the superclass of the given
Type t.
Semantically equivalent to
Class.getSuperclass(). That is, with Classes X and Y
where X.getSuperclass() returns Y, and the
Types tX and tY representing
X and Y respectively,
this.getSuperClass(tX) returns tY. It matches
Class.getSuperclass()'s behaviour for primitive, array and void
types, where the given Type's have the equivalent
Type.getSort() values.
Class.getSuperclass(),
Type.getSort()public boolean isAssignableFrom(org.kohsuke.asm6.Type to,
org.kohsuke.asm6.Type from)
Determines if the Type to is the same class, a
superclass, or superinterface of the given Type
from. Semantically equivalent to
Class.isAssignableFrom(Class), where to represents
this Class object. That is, with any given
Classes X and Y, and Types tX and tY, the following
statements will always be true:
X.isAssignableFrom(Y) ==
this.isAssignableFrom(tX, tY)
Class.isAssignableFrom(Class), this
method does not return true for Type's representing primitives
that can be converted (i.e. widened or narrowed) to represent the same
type.public TypeHierarchyReader.TypeHierarchy hierarchyOf(org.kohsuke.asm6.Type t)
TypeHierarchyReader.TypeHierarchy for the given Type t. TypeHierarchyReader.TypeHierarchy
results.protected TypeHierarchyReader.TypeHierarchy obtainHierarchyOf(org.kohsuke.asm6.ClassReader reader)
Copyright © 2004–2018. All rights reserved.