Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize​(java.lang.Object o)
      Initializes an existing uninitialized proxy instance.
      boolean isInitialized​(java.lang.Object o)
      Returns whether a lazy proxied instance has been initialized.
      boolean isInitialized​(java.lang.Object obj, java.lang.String associationName)
      Tests whether an association of the given object has been initialized.
      boolean isProxy​(java.lang.Object o)
      Returns true if the specified object is a proxy.
      java.lang.Object unwrapIfProxy​(java.lang.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​(java.lang.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​(java.lang.Object obj,
                                     java.lang.String associationName)
        Description copied from interface: ProxyHandler
        Tests whether an association of the given object has been initialized.
        Specified by:
        isInitialized in interface ProxyHandler
        Parameters:
        obj - The object to check
        associationName - The association
        Returns:
        true if has been init
      • unwrapIfProxy

        public java.lang.Object unwrapIfProxy​(java.lang.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​(java.lang.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​(java.lang.Object o)
        Description copied from interface: ProxyHandler
        Initializes an existing uninitialized proxy instance.
        Specified by:
        initialize in interface ProxyHandler
        Parameters:
        o - The proxy instance