org.codehaus.groovy.reflection
Class CachedClass
java.lang.Object
org.codehaus.groovy.reflection.CachedClass
- Direct Known Subclasses:
- CachedClass.ArrayCachedClass, CachedClass.BooleanCachedClass, CachedClass.CharacterCachedClass, CachedClass.NumberCachedClass, CachedClass.StringCachedClass
public class CachedClass
- extends java.lang.Object
- Author:
- Alex.Tkachman
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
cachedSuperClass
private CachedClass cachedSuperClass
EMPTY
private static final MetaMethod[] EMPTY
hashCode
int hashCode
reflector
private Reflector reflector
metaClassForClass
private volatile java.lang.Object metaClassForClass
fields
private CachedField[] fields
constructors
private CachedConstructor[] constructors
methods
private CachedMethod[] methods
cachedClass
private final java.lang.Class cachedClass
newMetaMethods
private MetaMethod[] newMetaMethods
mopMethods
public CachedMethod[] mopMethods
EMPTY_ARRAY
public static final CachedClass[] EMPTY_ARRAY
staticMetaClassField
private java.lang.Object staticMetaClassField
NONE
private static final java.lang.Object NONE
ownInterfaces
private java.util.Set ownInterfaces
interfaces
private java.util.Set interfaces
isArray
public final boolean isArray
isPrimitive
public final boolean isPrimitive
modifiers
public final int modifiers
distance
int distance
isInterface
public final boolean isInterface
isNumber
public final boolean isNumber
CachedClass
CachedClass(java.lang.Class klazz)
getInterfaces
public java.util.Set getInterfaces()
getOwnInterfaces
public java.util.Set getOwnInterfaces()
initialize
final 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.
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.
getMethods
public CachedMethod[] getMethods()
getFields
public CachedField[] getFields()
getConstructors
public CachedConstructor[] getConstructors()
searchMethods
public CachedMethod searchMethods(java.lang.String name,
CachedClass[] parameterTypes)
getModifiers
public final int getModifiers()
coerceArgument
public java.lang.Object coerceArgument(java.lang.Object argument)
getSuperClassDistance
public int getSuperClassDistance()
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
isPrimitive
public boolean isPrimitive()
isVoid
public boolean isVoid()
box
public void box(BytecodeHelper helper)
unbox
public void unbox(BytecodeHelper helper)
isInterface
public boolean isInterface()
doCast
public void doCast(BytecodeHelper helper)
getName
public java.lang.String getName()
getTypeDescription
public java.lang.String getTypeDescription()
getReflector
public Reflector getReflector()
getCachedClass
public final java.lang.Class getCachedClass()
getNewMetaMethods
public MetaMethod[] getNewMetaMethods()
setNewMopMethods
public void setNewMopMethods(java.util.ArrayList arr)
setStaticMetaClassField
public void setStaticMetaClassField(MetaClass mc)
getMetaClassForClass
public MetaClass getMetaClassForClass()
setMetaClassForClass
public void setMetaClassForClass(MetaClass metaClassForClass,
boolean isConst)
isAssignableFrom
public boolean isAssignableFrom(java.lang.Class argument)
isDirectlyAssignable
boolean isDirectlyAssignable(java.lang.Object argument)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © ${year} The Codehaus. All Rights Reserved.