public class Decorating<U,T>
extends java.lang.Object
An InvocationDecorator is used for the additional functionality. It is called before the original method is called, after the original method was called, after the original method has thrown an exception or when an exception occurs, calling the method of the decorated object.
com.thoughtworks.proxy.toys.decorate| Modifier and Type | Class and Description |
|---|---|
static class |
Decorating.DecoratingBuild<U,T> |
static class |
Decorating.DecoratingVisitor<U,T> |
static class |
Decorating.DecoratingWith<T> |
| Modifier and Type | Field and Description |
|---|---|
private Decorator<T> |
decorator |
private U |
delegate |
private java.lang.Class<?>[] |
types |
| Modifier | Constructor and Description |
|---|---|
private |
Decorating(U delegate,
java.lang.Class<T> primaryType,
java.lang.Class<?>... types) |
| Modifier and Type | Method and Description |
|---|---|
static <T> Decorating.DecoratingWith<T> |
proxy(java.lang.Class<T> type)
Creates a factory for proxy instances that allow decoration.
|
static <T> Decorating.DecoratingWith<T> |
proxy(java.lang.Class<T> primaryType,
java.lang.Class<?>... types)
Creates a factory for proxy instances that allow decoration.
|
static <U> Decorating.DecoratingVisitor<U,U> |
proxy(U delegate)
Creates a factory for proxy instances that allow decoration.
|
static <U,T> Decorating.DecoratingVisitor<U,T> |
proxy(U delegate,
java.lang.Class<T> type)
Creates a factory for proxy instances that allow decoration.
|
static <U,T> Decorating.DecoratingVisitor<U,T> |
proxy(U delegate,
java.lang.Class<T> primaryType,
java.lang.Class<?>... types)
Creates a factory for proxy instances that allow decoration.
|
private U delegate
private java.lang.Class<?>[] types
public static <T> Decorating.DecoratingWith<T> proxy(java.lang.Class<T> type)
public static <T> Decorating.DecoratingWith<T> proxy(java.lang.Class<T> primaryType, java.lang.Class<?>... types)
primaryType - the primary type implemented by the proxytypes - other types that are implemented by the proxypublic static <U> Decorating.DecoratingVisitor<U,U> proxy(U delegate)
delegate - the delegatepublic static <U,T> Decorating.DecoratingVisitor<U,T> proxy(U delegate, java.lang.Class<T> type)
delegate - the delegatetype - the type of the proxy when it is finally created.public static <U,T> Decorating.DecoratingVisitor<U,T> proxy(U delegate, java.lang.Class<T> primaryType, java.lang.Class<?>... types)
delegate - the delegateprimaryType - the primary type implemented by the proxytypes - other types that are implemented by the proxy