Package org.jdbi.v3.sqlobject
Class HandlerDecorators
- java.lang.Object
-
- org.jdbi.v3.sqlobject.HandlerDecorators
-
- All Implemented Interfaces:
JdbiConfig<HandlerDecorators>
public class HandlerDecorators extends Object implements JdbiConfig<HandlerDecorators>
Registry forhandler decorators. Decorators may modify or augment the behavior of a method Handler in some way. Out of the box, a decorator is registered which applies decorations for anydecorating annotationspresent on a SQL method. For example, using theTransactionannotation will cause a SQL method to be executed within a transaction. Decorators are applied in the order registered, from innermost to outermost: the last registered decorator will be the outermost decorator around the method handler.
-
-
Constructor Summary
Constructors Constructor Description HandlerDecorators()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandlerapplyDecorators(Handler base, Class<?> sqlObjectType, Method method)Applies all registered decorators to the given handlerHandlerDecoratorscreateCopy()HandlerDecoratorsregister(HandlerDecorator decorator)Registers the given handler decorator with the registry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
-
-
-
Method Detail
-
register
public HandlerDecorators register(HandlerDecorator decorator)
Registers the given handler decorator with the registry.- Parameters:
decorator- the decorator to register- Returns:
- this
-
applyDecorators
public Handler applyDecorators(Handler base, Class<?> sqlObjectType, Method method)
Applies all registered decorators to the given handler- Parameters:
base- the base handlersqlObjectType- the SQL object typemethod- the SQL method to be decorated- Returns:
- the decorated handler
-
createCopy
public HandlerDecorators createCopy()
- Specified by:
createCopyin interfaceJdbiConfig<HandlerDecorators>
-
-