net.sf.cglib.reflect

Class FastClass

public abstract class FastClass extends Object

Nested Class Summary
static classFastClass.Generator
Method Summary
static FastClasscreate(Class type)
static FastClasscreate(ClassLoader loader, Class type)
booleanequals(Object o)
FastConstructorgetConstructor(Constructor constructor)
FastConstructorgetConstructor(Class[] parameterTypes)
abstract intgetIndex(String name, Class[] parameterTypes)
Return the index of the matching method.
abstract intgetIndex(Class[] parameterTypes)
Return the index of the matching constructor.
abstract intgetIndex(Signature sig)
ClassgetJavaClass()
abstract intgetMaxIndex()
Returns the maximum method index for this class.
FastMethodgetMethod(Method method)
FastMethodgetMethod(String name, Class[] parameterTypes)
StringgetName()
inthashCode()
Objectinvoke(String name, Class[] parameterTypes, Object obj, Object[] args)
abstract Objectinvoke(int index, Object obj, Object[] args)
Invoke the method with the specified index.
ObjectnewInstance()
ObjectnewInstance(Class[] parameterTypes, Object[] args)
abstract ObjectnewInstance(int index, Object[] args)
Create a new instance using the specified constructor index and arguments.
StringtoString()

Method Detail

create

public static FastClass create(Class type)

create

public static FastClass create(ClassLoader loader, Class type)

equals

public boolean equals(Object o)

getConstructor

public FastConstructor getConstructor(Constructor constructor)

getConstructor

public FastConstructor getConstructor(Class[] parameterTypes)

getIndex

public abstract int getIndex(String name, Class[] parameterTypes)
Return the index of the matching method. The index may be used later to invoke the method with less overhead. If more than one method matches (i.e. they differ by return type only), one is chosen arbitrarily.

Parameters: name the method name parameterTypes the parameter array

Returns: the index, or -1 if none is found.

See Also: (int, Object, Object[])

getIndex

public abstract int getIndex(Class[] parameterTypes)
Return the index of the matching constructor. The index may be used later to create a new instance with less overhead.

Parameters: parameterTypes the parameter array

Returns: the constructor index, or -1 if none is found.

See Also: (int, Object[])

getIndex

public abstract int getIndex(Signature sig)

getJavaClass

public Class getJavaClass()

getMaxIndex

public abstract int getMaxIndex()
Returns the maximum method index for this class.

getMethod

public FastMethod getMethod(Method method)

getMethod

public FastMethod getMethod(String name, Class[] parameterTypes)

getName

public String getName()

hashCode

public int hashCode()

invoke

public Object invoke(String name, Class[] parameterTypes, Object obj, Object[] args)

invoke

public abstract Object invoke(int index, Object obj, Object[] args)
Invoke the method with the specified index.

Parameters: index the method index obj the object the underlying method is invoked from args the arguments used for the method call

Throws: java.lang.reflect.InvocationTargetException if the underlying method throws an exception

See Also: getIndex(name, Class[])

newInstance

public Object newInstance()

newInstance

public Object newInstance(Class[] parameterTypes, Object[] args)

newInstance

public abstract Object newInstance(int index, Object[] args)
Create a new instance using the specified constructor index and arguments.

Parameters: index the constructor index args the arguments passed to the constructor

Throws: java.lang.reflect.InvocationTargetException if the constructor throws an exception

See Also: getIndex(Class[])

toString

public String toString()
Copyright (c) 2001 - Apache Software Foundation