org.codehaus.groovy.reflection
Class CachedClass

author:
Alex.Tkachman

Field Summary
 def EMPTY
           
 def EMPTY_ARRAY
           
 Object NONE
           
 Class cachedClass
           
 CachedClass cachedSuperClass
           
 def constructors
           
 int distance
           
 def fields
           
 int hashCode
           
 Set interfaces
           
 boolean isArray
           
 boolean isInterface
           
 boolean isNumber
           
 boolean isPrimitive
           
 Object metaClassForClass
           
 def methods
           
 int modifiers
           
 def mopMethods
           
 def newMetaMethods
           
 Set ownInterfaces
           
 Reflector reflector
           
 Object staticMetaClassField
           
 
Constructor Summary
CachedClass(Class klazz)
           
 
Method Summary
void box(BytecodeHelper helper)
          
Object coerceArgument(Object argument)
          
void doCast(BytecodeHelper helper)
          
Class getCachedClass()
          
CachedClass getCachedSuperClass()
           This can't be final because ReflectionClass has an inner class that extends CachedClass for java.lang.Object (ReflectionClass.OBJECT_CLASS) that returns null for this method.
def getConstructors()
          
def getFields()
          
Set getInterfaces()
          
MetaClass getMetaClassForClass()
          
def getMethods()
          
int getModifiers()
          
String getName()
          
def getNewMetaMethods()
          
Set getOwnInterfaces()
          
Reflector getReflector()
          
int getSuperClassDistance()
          
String getTypeDescription()
          
int hashCode()
          
void initialize()
           Initialization involves making calls back to ReflectionCache to popuplate the "assignable from" structure.
boolean isAssignableFrom(Class argument)
          
boolean isDirectlyAssignable(Object argument)
          
boolean isInterface()
          
boolean isPrimitive()
          
boolean isVoid()
          
CachedMethod searchMethods(String name, def parameterTypes)
          
void setMetaClassForClass(MetaClass metaClassForClass, boolean isConst)
          
void setNewMopMethods(ArrayList arr)
          
void setStaticMetaClassField(MetaClass mc)
          
void unbox(BytecodeHelper helper)
          
 

Constructor Detail

CachedClass

public CachedClass(Class klazz)


Method Detail

box

public void box(BytecodeHelper helper)


coerceArgument

public Object coerceArgument(Object argument)


doCast

public void doCast(BytecodeHelper helper)


getCachedClass

public Class getCachedClass()


getCachedSuperClass

public CachedClass getCachedSuperClass()
This can't be final because ReflectionClass has an inner class that extends CachedClass for java.lang.Object (ReflectionClass.OBJECT_CLASS) that returns null for this method.


getConstructors

public def getConstructors()


getFields

public def getFields()


getInterfaces

public Set getInterfaces()


getMetaClassForClass

public MetaClass getMetaClassForClass()


getMethods

public def getMethods()


getModifiers

public int getModifiers()


getName

public String getName()


getNewMetaMethods

public def getNewMetaMethods()


getOwnInterfaces

public Set getOwnInterfaces()


getReflector

public Reflector getReflector()


getSuperClassDistance

public int getSuperClassDistance()


getTypeDescription

public String getTypeDescription()


hashCode

public int hashCode()


initialize

public void initialize()
Initialization involves making calls back to ReflectionCache to popuplate the "assignable from" structure. Package scoped (like our constructor) because ReflectionCache is really the only place we should be called from. We don't need to be synchronized here because ReflectionCache is careful to make sure we're called exactly once. By the same token we could however safely lock ourself. But the idea here is to take out the bad locks.


isAssignableFrom

public boolean isAssignableFrom(Class argument)


isDirectlyAssignable

public boolean isDirectlyAssignable(Object argument)


isInterface

public boolean isInterface()


isPrimitive

public boolean isPrimitive()


isVoid

public boolean isVoid()


searchMethods

public CachedMethod searchMethods(String name, def parameterTypes)


setMetaClassForClass

public void setMetaClassForClass(MetaClass metaClassForClass, boolean isConst)


setNewMopMethods

public void setNewMopMethods(ArrayList arr)


setStaticMetaClassField

public void setStaticMetaClassField(MetaClass mc)


unbox

public void unbox(BytecodeHelper helper)