com.opensymphony.xwork2.util

## Class ProxyUtil

- java.lang.Object
- - com.opensymphony.xwork2.util.ProxyUtil

-     public class ProxyUtil
      extends Object

  `ProxyUtil`

  Various utility methods dealing with proxies

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProxyUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Object` | `getHibernateProxyTarget(Object object)`
    `static boolean` | `isHibernateProxy(Object object)` Check whether the given object is a Hibernate proxy.
    `static boolean` | `isHibernateProxyMember(Member member)` Check whether the given member is a member of a Hibernate proxy.
    `static boolean` | `isProxy(Object object)` Check whether the given object is a proxy.
    `static boolean` | `isProxyMember(Member member, Object object)` Check whether the given member is a proxy member of a proxy object or is a static proxy member.
    `static Member` | `resolveTargetMember(Member proxyMember, Object target)`
    `static void` | `setProxyCacheFactory(ProxyCacheFactory<?,?> factory)` Sets the cache factory.
    `static Class<?>` | `ultimateTargetClass(Object candidate)` Determine the ultimate target class of the given instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProxyUtil

          public ProxyUtil()

  - ### Method Detail

    - #### setProxyCacheFactory

          public static void setProxyCacheFactory(ProxyCacheFactory<?,?> factory)

      Sets the cache factory. Called by the container during initialization. Resets existing caches so they are recreated with the new factory.
      Parameters:
        `factory` - the cache factory to use for creating proxy caches
      Since:
        6.9.0

    - #### ultimateTargetClass

          public static Class<?> ultimateTargetClass(Object candidate)

      Determine the ultimate target class of the given instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects.
      Parameters:
        `candidate` - the instance to check (might be a proxy)
      Returns:
        the ultimate target class (or the plain class of the given object as fallback; never `null`)

    - #### isProxy

          public static boolean isProxy(Object object)

      Check whether the given object is a proxy.
      Parameters:
        `object` - the object to check

    - #### isProxyMember

          public static boolean isProxyMember(Member member,
                                              Object object)

      Check whether the given member is a proxy member of a proxy object or is a static proxy member.
      Parameters:
        `member` - the member to check
        `object` - the object to check

    - #### isHibernateProxy

          public static boolean isHibernateProxy(Object object)

      Check whether the given object is a Hibernate proxy.
      Parameters:
        `object` - the object to check

    - #### isHibernateProxyMember

          public static boolean isHibernateProxyMember(Member member)

      Check whether the given member is a member of a Hibernate proxy.
      Parameters:
        `member` - the member to check

    - #### getHibernateProxyTarget

          public static Object getHibernateProxyTarget(Object object)

      Returns:
        the target instance of the given object if it is a Hibernate proxy object, otherwise the given object

    - #### resolveTargetMember

          public static Member resolveTargetMember(Member proxyMember,
                                                   Object target)

      Returns:
        matching member on target object if one exists, otherwise the same member

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.