Class ProxyBuilder<T>
java.lang.Object
org.wickedsource.docxstamper.proxy.ProxyBuilder<T>
- Type Parameters:
T- the type of the root object.
Allows an object to be wrapped by a proxy so that it will implement additional interfaces.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a proxy object out of the specified root object and the specified interfaces and implementations.withInterface(Class<?> interfaceClass, Object interfaceImpl) Specifies an interfaces and an implementation of an interface by which the root object shall be extended.Specifies the root object for the proxy that shall be enhanced.
-
Constructor Details
-
ProxyBuilder
public ProxyBuilder()
-
-
Method Details
-
withRoot
Specifies the root object for the proxy that shall be enhanced.- Parameters:
rootObject- the root object.- Returns:
- this builder for chaining.
-
withInterface
Specifies an interfaces and an implementation of an interface by which the root object shall be extended.- Parameters:
interfaceClass- the class of the interfaceinterfaceImpl- an implementation of the interface- Returns:
- this builder for chaining.
-
build
Creates a proxy object out of the specified root object and the specified interfaces and implementations.- Returns:
- a proxy object that is still of type T but additionally implements all specified interfaces.
- Throws:
ProxyException- if the proxy could not be created.
-