Top Inners Fields Constructors Methods
org.springframework.cglib.reflect

public abstract Class FastClass

extends Object
Class Inheritance
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
java.lang.reflect.Constructor, .InvocationTargetException, .Method, java.security.ProtectionDomain, org.springframework.asm.ClassVisitor, .Type, org.springframework.cglib.core.AbstractClassGenerator, .Constants, .ReflectUtils, .Signature

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private Class<T>

Constructor Summary

AccessConstructor and Description
protected
protected
FastClass(Class<T> type)

Method Summary

Modifier and TypeMethod and Description
public static FastClass
create(Class<T> type)

public static FastClass
create(ClassLoader loader, Class<T> type)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public FastConstructor
getConstructor(Constructor<T> constructor)

public FastConstructor
getConstructor(Class<T>[] parameterTypes)

public abstract int

Returns:

the index, or -1 if none is found.
getIndex
(String
the method name
name
,
Class<T>[]
the parameter array
parameterTypes
)

Return the index of the matching method.

public abstract int

Returns:

the constructor index, or -1 if none is found.
getIndex
(Class<T>[]
the parameter array
parameterTypes
)

Return the index of the matching constructor.

public abstract int
public Class<T>
public abstract int
getMaxIndex()

Returns the maximum method index for this class.

public FastMethod
getMethod(Method method)

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

public String
protected static String
getSignatureWithoutReturnType(String name, Class<T>[] parameterTypes)

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

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

public abstract Object
invoke(int
the method index
index
,
Object
the object the underlying method is invoked from
obj
,
Object[]
the arguments used for the method call
args
)

Invoke the method with the specified index.

public Object
public Object
newInstance(Class<T>[] parameterTypes, Object[] args)

public abstract Object
newInstance(int
the constructor index
index
,
Object[]
the arguments passed to the constructor
args
)

Create a new instance using the specified constructor index and arguments.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

typeback to summary
private Class<T> type

Constructor Detail

FastClassback to summary
protected FastClass()
FastClassback to summary
protected FastClass(Class<T> type)

Method Detail

createback to summary
public static FastClass create(Class<T> type)
createback to summary
public static FastClass create(ClassLoader loader, Class<T> type)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getConstructorback to summary
public FastConstructor getConstructor(Constructor<T> constructor)
getConstructorback to summary
public FastConstructor getConstructor(Class<T>[] parameterTypes)
getIndexback to summary
public abstract int getIndex(String name, Class<T>[] 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:String

the method name

parameterTypes:Class<T>[]

the parameter array

Returns:int

the index, or -1 if none is found.

See Also
invoke(int, Object, Object[])
getIndexback to summary
public abstract int getIndex(Class<T>[] parameterTypes)

Return the index of the matching constructor. The index may be used later to create a new instance with less overhead.

Parameters
parameterTypes:Class<T>[]

the parameter array

Returns:int

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

See Also
newInstance(int, Object[])
getIndexback to summary
public abstract int getIndex(Signature sig)
getJavaClassback to summary
public Class<T> getJavaClass()
getMaxIndexback to summary
public abstract int getMaxIndex()

Returns the maximum method index for this class.

getMethodback to summary
public FastMethod getMethod(Method method)
getMethodback to summary
public FastMethod getMethod(String name, Class<T>[] parameterTypes)
getNameback to summary
public String getName()
getSignatureWithoutReturnTypeback to summary
protected static String getSignatureWithoutReturnType(String name, Class<T>[] parameterTypes)
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
invokeback to summary
public Object invoke(String name, Class<T>[] parameterTypes, Object obj, Object[] args) throws InvocationTargetException
invokeback to summary
public abstract Object invoke(int index, Object obj, Object[] args) throws InvocationTargetException

Invoke the method with the specified index.

Parameters
index:int

the method index

obj:Object

the object the underlying method is invoked from

args:Object[]

the arguments used for the method call

Exceptions
InvocationTargetException:
if the underlying method throws an exception
See Also
getIndex(name, Class[])
newInstanceback to summary
public Object newInstance() throws InvocationTargetException
newInstanceback to summary
public Object newInstance(Class<T>[] parameterTypes, Object[] args) throws InvocationTargetException
newInstanceback to summary
public abstract Object newInstance(int index, Object[] args) throws InvocationTargetException

Create a new instance using the specified constructor index and arguments.

Parameters
index:int

the constructor index

args:Object[]

the arguments passed to the constructor

Exceptions
InvocationTargetException:
if the constructor throws an exception
See Also
getIndex(Class[])
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.springframework.cglib.reflect back to summary

public Class FastClass.Generator

extends AbstractClassGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final AbstractClassGenerator.Source
private Class<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public FastClass
protected Object
public void
protected ClassLoader
protected ProtectionDomain
getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Returns the protection domain to use when defining the class.

protected Object
public void
setType(Class<T> type)

Inherited from org.springframework.cglib.core.AbstractClassGenerator:
creategenerategetAttemptLoadgetClassLoadergetClassNamegetCurrentgetNamingPolicygetStrategygetUseCachesetAttemptLoadsetClassLoadersetContextClasssetNamePrefixsetNamingPolicysetStrategysetUseCacheunwrapCachedValuewrapCachedClass

Field Detail

SOURCEback to summary
private static final AbstractClassGenerator.Source SOURCE
typeback to summary
private Class<T> type

Constructor Detail

Generatorback to summary
public Generator()

Method Detail

createback to summary
public FastClass create()
firstInstanceback to summary
protected Object firstInstance(Class<T> type)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.firstInstance.

Annotations
@Override
generateClassback to summary
public void generateClass(ClassVisitor v) throws Exception

Implements org.springframework.cglib.core.ClassGenerator.generateClass.

Annotations
@Override
getDefaultClassLoaderback to summary
protected ClassLoader getDefaultClassLoader()

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.getDefaultClassLoader.

Annotations
@Override
getProtectionDomainback to summary
protected ProtectionDomain getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Doc from org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Returns the protection domain to use when defining the class.

Default implementation returns null for using a default protection domain. Sub-classes may override to use a more specific protection domain.

Returns:ProtectionDomain

the protection domain (null for using a default)

Annotations
@Override
nextInstanceback to summary
protected Object nextInstance(Object instance)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.nextInstance.

Annotations
@Override
setTypeback to summary
public void setType(Class<T> type)