gnu.bytecode

Class ObjectType

public class ObjectType extends Type

Semi-abstract class object reference types.

Extended by ClassType and ArrayType.

Field Summary
intflags
Constructor Summary
protected ObjectType()
ObjectType(String name)
Method Summary
ObjectcoerceFromObject(Object obj)
Convert an object to a value of this Type.
intcompare(Type other)
voidemitCoerceFromObject(CodeAttr code)
Compile (in given method) cast from Object to this Type.
static ClassgetContextClass(String cname)
Get named class using context class loader.
TypegetImplementationType()
StringgetInternalName()
Returns class name if a class type, signature if an array type.
intgetMethods(Filter filter, int searchSupers, Vector result, String context)
ClassgetReflectClass()
Get the java.lang.Class object for the representation type.
booleanisExisting()
booleanisInstance(Object obj)
Typepromote()
voidsetExisting(boolean existing)

Field Detail

flags

public int flags

Constructor Detail

ObjectType

protected ObjectType()

ObjectType

public ObjectType(String name)

Method Detail

coerceFromObject

public Object coerceFromObject(Object obj)
Convert an object to a value of this Type. Throw a ClassCastException when this is not possible.

compare

public int compare(Type other)

emitCoerceFromObject

public void emitCoerceFromObject(CodeAttr code)
Compile (in given method) cast from Object to this Type.

getContextClass

public static Class getContextClass(String cname)
Get named class using context class loader. If the security policy prohibits that, fall back to this class's loader.

getImplementationType

public Type getImplementationType()

getInternalName

public String getInternalName()
Returns class name if a class type, signature if an array type. In both cases, uses '/' rather than '.' after packages prefixes. Seems rather arbitrary - but that is how classes are represented in the constant pool (CONSTANT_Class constants). Also, Class.forName is the same, except using '.'.

getMethods

public int getMethods(Filter filter, int searchSupers, Vector result, String context)

getReflectClass

public Class getReflectClass()
Get the java.lang.Class object for the representation type.

isExisting

public final boolean isExisting()

isInstance

public boolean isInstance(Object obj)

promote

public Type promote()

setExisting

public final void setExisting(boolean existing)