|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.ClassFile.Linker
public abstract class Linker
A Linker
object manages the association of symbolic names
to code/data/object descriptions.
Field Summary | |
---|---|
protected Map |
descCache
private linker cache, for efficiency. |
Constructor Summary | |
---|---|
protected |
Linker()
|
Method Summary | |
---|---|
HClass |
createMutableClass(String name,
HClass template)
Creates a new mutable class with the given name which is based on the given template class. |
HClass |
forClass(Class cls)
Deprecated. Don't use java.lang.Class objects if you can help it. |
HClass |
forDescriptor(String descriptor)
Returns the HClass object associated with the
ComponentType descriptor given. |
protected abstract HClass |
forDescriptor0(String descriptor)
Sub-classes will provide implementation for the forDescriptor0 method in order to implement
a linking strategy. |
HClass |
forName(String className)
Returns the HClass object associated with the class with
the given string name. |
protected HClass |
makeArray(HClass baseType,
int dims)
Allow Linker subclass to substitute a different (mutable?) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map descCache
Constructor Detail |
---|
protected Linker()
Method Detail |
---|
protected abstract HClass forDescriptor0(String descriptor) throws NoSuchClassException
forDescriptor0
method in order to implement
a linking strategy. This method is only passed descriptors for
class types; never array or primitive type descriptors.
(Hence neither primitive types or array types can be
re-linked, which might violate java language semantics.)
NoSuchClassException
- if the class could not be found.public HClass forDescriptor(String descriptor) throws NoSuchClassException
HClass
object associated with the
ComponentType descriptor given. Throws NoSuchClassException
if the descriptor references a class that cannot be found. Throws
Error
if an invalid descriptor is given.
Error
- if an invalid descriptor is given.
NoSuchClassException
- if the class could not be found.protected HClass makeArray(HClass baseType, int dims)
public final HClass forName(String className) throws NoSuchClassException
HClass
object associated with the class with
the given string name. Given the fully-qualified name for a class or
interface, this method attempts to locate and load the class. If it
succeeds, returns the HClass
object representing the class.
If it fails, the method throws a NoSuchClassException
.
className
- the fully qualified name of the desired class.
HClass
descriptor for the class with the
specified name.
NoSuchClassException
- if the class could not be found.public final HClass forClass(Class cls) throws NoSuchClassException
HClass
object associated with the given java
Class
object. If (for some reason) the class file
cannot be found, the method throws a NoSuchClassException
.
HClass
descriptor for this Class
.
NoSuchClassException
- if the classfile could not be found.public HClass createMutableClass(String name, HClass template) throws DuplicateClassException
name
must be unique.
DuplicateClassException
- if the given name is not unique;
that is, it corresponds to a loadable class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |