org.codehaus.groovy.grails.support.proxy
Class DefaultProxyHandler

java.lang.Object
  extended by org.codehaus.groovy.grails.support.proxy.DefaultProxyHandler
All Implemented Interfaces:
ProxyHandler

public class DefaultProxyHandler
extends Object
implements ProxyHandler

Trivial default implementation that always returns true and the object

Since:
1.2.2
Author:
Graeme Rocher

Constructor Summary
DefaultProxyHandler()
           
 
Method Summary
 void initialize(Object o)
          Initializes an existing uninitialized proxy instance
 boolean isInitialized(Object o)
          Returns whether a lazy proxied instance has been initialized
 boolean isInitialized(Object obj, String associationName)
          Tests whether an association of the given object has been initialized or not
 boolean isProxy(Object o)
          Returns true if the specified object is a proxy
 Object unwrapIfProxy(Object instance)
          Returns the unwrapped proxy instance or the original object if not proxied
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProxyHandler

public DefaultProxyHandler()
Method Detail

isInitialized

public boolean isInitialized(Object o)
Description copied from interface: ProxyHandler
Returns whether a lazy proxied instance has been initialized

Specified by:
isInitialized in interface ProxyHandler
Parameters:
o - The instance to test
Returns:
True if it has been initialized false otherwise

isInitialized

public boolean isInitialized(Object obj,
                             String associationName)
Description copied from interface: ProxyHandler
Tests whether an association of the given object has been initialized or not

Specified by:
isInitialized in interface ProxyHandler
Parameters:
obj - The object to check
associationName - The association
Returns:
True if has been init

unwrapIfProxy

public Object unwrapIfProxy(Object instance)
Description copied from interface: ProxyHandler
Returns the unwrapped proxy instance or the original object if not proxied

Specified by:
unwrapIfProxy in interface ProxyHandler
Parameters:
instance - The instance to unwrap
Returns:
The unwrapped instance

isProxy

public boolean isProxy(Object o)
Description copied from interface: ProxyHandler
Returns true if the specified object is a proxy

Specified by:
isProxy in interface ProxyHandler
Parameters:
o - The object in question
Returns:
True if it is a proxy

initialize

public void initialize(Object o)
Description copied from interface: ProxyHandler
Initializes an existing uninitialized proxy instance

Specified by:
initialize in interface ProxyHandler
Parameters:
o - The proxy instance


Copyright (c) 2005-2009 The Grails project