Top Fields Constructors Methods
org.springframework.cglib.proxy

public abstract Class CallbackHelper

extends Object
implements CallbackFilter
Class Inheritance
All Implemented Interfaces
org.springframework.cglib.proxy.CallbackFilter
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
java.lang.reflect.Method, java.util.ArrayList, .HashMap, .List, .Map, org.springframework.cglib.core.ReflectUtils

Version
$Id: CallbackHelper.java,v 1.2 2004/06/24 21:15:20 herbyderby Exp $

Field Summary

Modifier and TypeField and Description
private List<E>
private Map<K, V>

Constructor Summary

AccessConstructor and Description
public
CallbackHelper(Class<T> superclass, Class<T>[] interfaces)

Method Summary

Modifier and TypeMethod and Description
public int
accept(Method
the intercepted method
method
)

Implements org.springframework.cglib.proxy.CallbackFilter.accept.

Map a method to a callback.

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

Overrides java.lang.Object.equals.

Implements org.springframework.cglib.proxy.CallbackFilter.equals.

The CallbackFilter in use affects which cached class the Enhancer will use, so this is a reminder that you should correctly implement equals and hashCode for custom CallbackFilter implementations in order to improve performance.

protected abstract Object
public Callback[]
public Class<T>[]
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

callbacksback to summary
private List<E> callbacks
methodMapback to summary
private Map<K, V> methodMap

Constructor Detail

CallbackHelperback to summary
public CallbackHelper(Class<T> superclass, Class<T>[] interfaces)

Method Detail

acceptback to summary
public int accept(Method method)

Implements org.springframework.cglib.proxy.CallbackFilter.accept.

Doc from org.springframework.cglib.proxy.CallbackFilter.accept.

Map a method to a callback.

Parameters
method:Method

the intercepted method

Returns:int

the index into the array of callbacks (as specified by Enhancer#setCallbacks) to use for the method,

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements org.springframework.cglib.proxy.CallbackFilter.equals.

Doc from org.springframework.cglib.proxy.CallbackFilter.equals.

The CallbackFilter in use affects which cached class the Enhancer will use, so this is a reminder that you should correctly implement equals and hashCode for custom CallbackFilter implementations in order to improve performance.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

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

Annotations
@Override
getCallbackback to summary
protected abstract Object getCallback(Method method)
getCallbacksback to summary
public Callback[] getCallbacks()
getCallbackTypesback to summary
public Class<T>[] getCallbackTypes()
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