Package org.coliper.ibean.proxy.handler
Class NullSafeHandler
- java.lang.Object
-
- org.coliper.ibean.proxy.handler.StatelessExtensionHandler
-
- org.coliper.ibean.proxy.handler.NullSafeHandler
-
- All Implemented Interfaces:
ExtensionHandler
public class NullSafeHandler extends StatelessExtensionHandler
ExtensionHandlerimplementation for bean extension interfaceNullSafe.
-
-
Field Summary
Fields Modifier and Type Field Description static ExtensionSupportSUPPORTExtensionSupportrelated to this handler supposed to be used when configuring extension handlers inIBeanFactorys, for example inProxyIBeanFactory.Builder.withInterfaceSupport(ExtensionSupport).
-
Constructor Summary
Constructors Constructor Description NullSafeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectinterceptGetterCall(IBeanContext<?> context, IBeanFieldMetaInfo fieldMeta, Object returnValue, Object proxyInstance)Called as an optional hook with every getter call on an IBean.-
Methods inherited from class org.coliper.ibean.proxy.handler.StatelessExtensionHandler
handleExtendedInterfaceCall
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.coliper.ibean.proxy.ExtensionHandler
interceptSetterCall, onInitStateful
-
-
-
-
Field Detail
-
SUPPORT
public static final ExtensionSupport SUPPORT
ExtensionSupportrelated to this handler supposed to be used when configuring extension handlers inIBeanFactorys, for example inProxyIBeanFactory.Builder.withInterfaceSupport(ExtensionSupport).
-
-
Method Detail
-
interceptGetterCall
public Object interceptGetterCall(IBeanContext<?> context, IBeanFieldMetaInfo fieldMeta, Object returnValue, Object proxyInstance)
Description copied from interface:ExtensionHandlerCalled as an optional hook with every getter call on an IBean. Getter calls on IBeans are handled by the IBean implementation itself but anExtensionHandlercan 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 alsoProxyIBeanFactory.Builder.withInterfaceSupport(ExtensionSupport).The default implementation just returns
returnValue.- Parameters:
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 itself- Returns:
- the value to be returned from the getter call. If you do not want
to change the getter return value just pass the value provided in
returnValue
-
-