com.opensymphony.xwork2.ognl.accessor

## Class CompoundRootAccessor

- java.lang.Object
- - com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor

- All Implemented Interfaces:
    RootAccessor, ognl.ClassResolver, ognl.MethodAccessor, ognl.PropertyAccessor, InternalDestroyable

      public class CompoundRootAccessor
      extends Object
      implements RootAccessor, InternalDestroyable

  A stack that is able to call methods on objects in the stack.
  Version:
    $Revision$
  Author:
    $Author$, Rainer Hermanns

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompoundRootAccessor()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `callMethod(Map context, Object target, String name, Object[] objects)`
    `Object` | `callStaticMethod(Map transientVars, Class aClass, String s, Object[] objects)`
    `Class` | `classForName(String className, Map context)`
    `static void` | `clearCache()` Clears the cached invalid methods map to prevent classloader leaks on hot redeploy.
    `void` | `destroy()` Releases static state held by this component.
    `Object` | `getProperty(Map context, Object target, Object name)`
    `String` | `getSourceAccessor(ognl.OgnlContext context, Object target, Object index)` Used by OGNl to generate bytecode
    `String` | `getSourceSetter(ognl.OgnlContext context, Object target, Object index)` Used by OGNl to generate bytecode
    `protected void` | `setDevMode(String mode)`
    `void` | `setProperty(Map context, Object target, Object name, Object value)`
    `void` | `useDisallowCustomOgnlMap(String disallowCustomOgnlMap)`

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

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

- - ### Constructor Detail

    - #### CompoundRootAccessor

          public CompoundRootAccessor()

  - ### Method Detail

    - #### getSourceAccessor

          public String getSourceAccessor(ognl.OgnlContext context,
                                          Object target,
                                          Object index)

      Used by OGNl to generate bytecode
      Specified by:
        `getSourceAccessor` in interface `ognl.PropertyAccessor`

    - #### getSourceSetter

          public String getSourceSetter(ognl.OgnlContext context,
                                        Object target,
                                        Object index)

      Used by OGNl to generate bytecode
      Specified by:
        `getSourceSetter` in interface `ognl.PropertyAccessor`

    - #### clearCache

          public static void clearCache()

      Clears the cached invalid methods map to prevent classloader leaks on hot redeploy.

    - #### destroy

          public void destroy()

      Description copied from interface: `InternalDestroyable`
      Releases static state held by this component. Called once during `Dispatcher.cleanup()`.
      Specified by:
        `destroy` in interface `InternalDestroyable`
      Since:
        6.9.0

    - #### setDevMode

          protected void setDevMode(String mode)

    - #### useDisallowCustomOgnlMap

          public void useDisallowCustomOgnlMap(String disallowCustomOgnlMap)

    - #### setProperty

          public void setProperty(Map context,
                                  Object target,
                                  Object name,
                                  Object value)
                           throws ognl.OgnlException

      Specified by:
        `setProperty` in interface `ognl.PropertyAccessor`
      Throws:
        `ognl.OgnlException`

    - #### getProperty

          public Object getProperty(Map context,
                                    Object target,
                                    Object name)
                             throws ognl.OgnlException

      Specified by:
        `getProperty` in interface `ognl.PropertyAccessor`
      Throws:
        `ognl.OgnlException`

    - #### callMethod

          public Object callMethod(Map context,
                                   Object target,
                                   String name,
                                   Object[] objects)
                            throws ognl.MethodFailedException

      Specified by:
        `callMethod` in interface `ognl.MethodAccessor`
      Throws:
        `ognl.MethodFailedException`

    - #### callStaticMethod

          public Object callStaticMethod(Map transientVars,
                                         Class aClass,
                                         String s,
                                         Object[] objects)
                                  throws ognl.MethodFailedException

      Specified by:
        `callStaticMethod` in interface `ognl.MethodAccessor`
      Throws:
        `ognl.MethodFailedException`

    - #### classForName

          public Class classForName(String className,
                                    Map context)
                             throws ClassNotFoundException

      Specified by:
        `classForName` in interface `ognl.ClassResolver`
      Throws:
        `ClassNotFoundException`

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