Package grails.core.support.proxy
Class DefaultProxyHandler
- java.lang.Object
-
- grails.core.support.proxy.DefaultProxyHandler
-
- All Implemented Interfaces:
ProxyHandler
public class DefaultProxyHandler extends java.lang.Object implements ProxyHandler
Trivial default implementation that always returns true and the object.- Since:
- 1.2.2
-
-
Constructor Summary
Constructors Constructor Description DefaultProxyHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(java.lang.Object o)Initializes an existing uninitialized proxy instance.booleanisInitialized(java.lang.Object o)Returns whether a lazy proxied instance has been initialized.booleanisInitialized(java.lang.Object obj, java.lang.String associationName)Tests whether an association of the given object has been initialized.booleanisProxy(java.lang.Object o)Returns true if the specified object is a proxy.java.lang.ObjectunwrapIfProxy(java.lang.Object instance)Returns the unwrapped proxy instance or the original object if not proxied.
-
-
-
Method Detail
-
isInitialized
public boolean isInitialized(java.lang.Object o)
Description copied from interface:ProxyHandlerReturns whether a lazy proxied instance has been initialized.- Specified by:
isInitializedin interfaceProxyHandler- Parameters:
o- The instance to test- Returns:
- true if it has been initialized false otherwise
-
isInitialized
public boolean isInitialized(java.lang.Object obj, java.lang.String associationName)Description copied from interface:ProxyHandlerTests whether an association of the given object has been initialized.- Specified by:
isInitializedin interfaceProxyHandler- Parameters:
obj- The object to checkassociationName- The association- Returns:
- true if has been init
-
unwrapIfProxy
public java.lang.Object unwrapIfProxy(java.lang.Object instance)
Description copied from interface:ProxyHandlerReturns the unwrapped proxy instance or the original object if not proxied.- Specified by:
unwrapIfProxyin interfaceProxyHandler- Parameters:
instance- The instance to unwrap- Returns:
- The unwrapped instance
-
isProxy
public boolean isProxy(java.lang.Object o)
Description copied from interface:ProxyHandlerReturns true if the specified object is a proxy.- Specified by:
isProxyin interfaceProxyHandler- Parameters:
o- The object in question- Returns:
- true if it is a proxy
-
initialize
public void initialize(java.lang.Object o)
Description copied from interface:ProxyHandlerInitializes an existing uninitialized proxy instance.- Specified by:
initializein interfaceProxyHandler- Parameters:
o- The proxy instance
-
-