|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.cglib.Delegator
Delegator
provides a number of static methods that allow
multiple objects to be combined into a single larger object. The
methods in the generated object simply call the original methods in the
underlying "delegate" objects.
Inner Class Summary | |
static interface |
Delegator.Factory
|
Method Summary | |
static java.lang.Object |
create(java.lang.Class[] interfaces,
java.lang.Object[] delegates,
java.lang.ClassLoader loader)
Returns an object that implements all of the specified interfaces. |
static java.lang.Object |
create(java.lang.Class type,
java.lang.Class[] interfaces,
java.lang.Object[] delegates,
java.lang.ClassLoader loader)
Returns an object that implements all of the specified interfaces. |
static java.lang.Object |
create(java.lang.Class type,
java.lang.Class[] interfaces,
java.lang.Object[] delegates,
int[] routing,
java.lang.ClassLoader loader)
Returns an object that implements all of the specified interfaces. |
static java.lang.Object |
create(java.lang.Object[] delegates,
java.lang.ClassLoader loader)
Returns an object that implements all of the interfaces implemented by the specified objects. |
static java.lang.Object |
createBean(java.lang.Class type,
java.lang.Object[] beans,
java.lang.ClassLoader loader)
Combines an array of JavaBeans into a single "super" bean. |
static java.lang.Object |
createBean(java.lang.Object[] beans,
java.lang.ClassLoader loader)
Combines an array of JavaBeans into a single "super" bean. |
static java.util.Map |
getInterfaceMap(java.lang.Object[] delegates)
Returns a Map that describes how interfaces would be delegated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.Object create(java.lang.Class[] interfaces, java.lang.Object[] delegates, java.lang.ClassLoader loader)
interfaces
- the array of interfaces to implementdelegates
- The array of delegates. Must be the same length
as the interface array, and each delegates must implements the
corresponding interface.loader
- The ClassLoader to use. If null uses the one that
loaded this class.public static java.lang.Object create(java.lang.Class type, java.lang.Class[] interfaces, java.lang.Object[] delegates, java.lang.ClassLoader loader)
type
- the Class to extend, uses Object if nullinterfaces
- the array of interfaces to implementdelegates
- The array of delegates. Must be the same length
as the interface array, and each delegates must implements the
corresponding interface.loader
- The ClassLoader to use. If null uses the one that
loaded this class.public static java.lang.Object create(java.lang.Class type, java.lang.Class[] interfaces, java.lang.Object[] delegates, int[] routing, java.lang.ClassLoader loader)
type
- the Class to extend, uses Object if nullinterfaces
- the array of interfaces to implementdelegates
- The array of delegates. If the routing parameter
is null, this must be the same length as the interface array. Each delegate
must implement the interfaces delegated to it.routing
- An optional routing table. Must be null, or the same length
as the interfaces array. If non null, the values represent which delegate
the corresponding interface should be mapped to. If null, a 1:1 correspondence
is assumed.loader
- The ClassLoader to use. If null uses the one that
loaded this class.public static java.lang.Object create(java.lang.Object[] delegates, java.lang.ClassLoader loader)
Note: interfaces which have no methods (marker interfaces) are not implemented by the returned object.
delegates
- the array of delegatesloader
- The ClassLoader to use. If null uses the one that
loaded this class.getInterfaceMap(Object[])
public static java.util.Map getInterfaceMap(java.lang.Object[] delegates)
create
methods. For each
interface, the Map value is the objects from the argument array
that would be used as a delegate.delegates
- the array of delegates#makeDelegator(Object[])
public static java.lang.Object createBean(java.lang.Object[] beans, java.lang.ClassLoader loader)
beans
- the list of beans to delegate toloader
- The ClassLoader to use. If null uses the one that loaded this class.public static java.lang.Object createBean(java.lang.Class type, java.lang.Object[] beans, java.lang.ClassLoader loader)
type
- the Class to extendbeans
- the list of beans to delegate to
if true, "set" methods will set all applicable beans, and "get" will return the value
from the last bean in the list.loader
- The ClassLoader to use. If null uses the one that loaded this class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |