public class NullSafeHandler extends StatelessExtensionHandler
ExtensionHandler implementation for bean extension interface
NullSafe.| Modifier and Type | Field and Description |
|---|---|
static ExtensionSupport |
SUPPORT
ExtensionSupport related to this handler supposed to be used when
configuring extension handlers in IBeanFactorys, for example in
ProxyIBeanFactory.Builder#withInterfaceSupport(ExtensionSupport). |
| Constructor and Description |
|---|
NullSafeHandler() |
| Modifier and Type | Method and Description |
|---|---|
Object |
interceptGetterCall(IBeanContext<?> context,
IBeanFieldMetaInfo fieldMeta,
Object returnValue,
Object proxyInstance)
Called as an optional hook with every getter call on an IBean.
|
handleExtendedInterfaceCallclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterceptSetterCall, onInitStatefulpublic static final ExtensionSupport SUPPORT
ExtensionSupport related to this handler supposed to be used when
configuring extension handlers in IBeanFactorys, for example in
ProxyIBeanFactory.Builder#withInterfaceSupport(ExtensionSupport).public Object interceptGetterCall(IBeanContext<?> context, IBeanFieldMetaInfo fieldMeta, Object returnValue, Object proxyInstance)
ExtensionHandlerExtensionHandler can implement this method to hook into the
getter call. It can just peak on the return value or it can even change
it or throw an exception.
When you have several extension handlers registered for an IBean type the
intercept calls will be called in the order in which the handlers are
registered in the ProxyIBeanFactory. See also
ProxyIBeanFactory.Builder.withInterfaceSupport(ExtensionSupport).
The default implementation just returns returnValue.
context - provides meta information about the IBeanfieldMeta - provides meta information about the field related to the
getterreturnValue - the current return value of the getter. This must not match to
the field value of the IBean as the value might have already
been changed by intercept calls from other handlersproxyInstance - the IBean instance itselfreturnValue