|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.thoughtworks.proxy.toys.delegate.Delegating
public class Delegating
Toy factory to create proxies delegating to another object.
Such a proxy is used to mask the methods of an object, that are not part of a public interface. Or it is used to make an object compatible, e.g. when an object implements the methods of an interface, but does not implement the interface itself.
com.thoughtworks.proxy.toys.delegate| Field Summary | |
|---|---|
static boolean |
DYNAMIC_TYPING
Deprecated. since 0.2, use MODE_SIGNATURE |
static int |
MODE_DIRECT
Delegate must implement the method's interface |
static int |
MODE_SIGNATURE
Delegate must have method with same name and matching signature - not necessarily the same |
static boolean |
STATIC_TYPING
Deprecated. since 0.2, use MODE_DIRECT |
| Method Summary | |
|---|---|
static Object |
object(Class type,
Object delegate)
Creating a delegating proxy for a signature compatible object. |
static Object |
object(Class type,
Object delegate,
int delegationMode)
Creating a delegating proxy for an object with a defined delegation mode. |
static Object |
object(Class type,
Object delegate,
ProxyFactory factory)
Creating a delegating proxy for a signature compatible object using a special ProxyFactory. |
static Object |
object(Class type,
Object delegate,
ProxyFactory factory,
int delegationMode)
Creating a delegating proxy for an object with a defined delegation mode using a special ProxyFactory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean STATIC_TYPING
MODE_DIRECT
public static final boolean DYNAMIC_TYPING
MODE_SIGNATURE
public static final int MODE_DIRECT
public static final int MODE_SIGNATURE
| Method Detail |
|---|
public static Object object(Class type,
Object delegate)
type - the type of the created proxy,delegate - the object the proxy delegates to.
public static Object object(Class type,
Object delegate,
int delegationMode)
type - the type of the created proxy,delegate - the object the proxy delegates to.delegationMode - one of the delegation modes MODE_DIRECT or MODE_SIGNATURE
IllegalArgumentException - if the delegationMode is not one of the predefined constants
public static Object object(Class type,
Object delegate,
ProxyFactory factory)
ProxyFactory.
type - the type of the created proxy,delegate - the object the proxy delegates to.factory - the ProxyFactory to use creating the proxy.
public static Object object(Class type,
Object delegate,
ProxyFactory factory,
int delegationMode)
ProxyFactory.
type - the type of the created proxy,delegate - the object the proxy delegates to.factory - the ProxyFactory to use creating the proxy.delegationMode - one of the delegation modes MODE_DIRECT or MODE_SIGNATURE
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||