org.apache.commons.jexl3.internal.introspection

## Class SandboxUberspect

- java.lang.Object
- - org.apache.commons.jexl3.internal.introspection.SandboxUberspect

- All Implemented Interfaces:
    JexlUberspect

      public final class SandboxUberspect
      extends Object
      implements JexlUberspect

  An uberspect that controls usage of properties, methods and constructors through a sandbox.
  Since:
    3.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.commons.jexl3.introspection.JexlUberspect

      `JexlUberspect.JexlResolver, JexlUberspect.PropertyResolver, JexlUberspect.ResolverStrategy`

  - ### Field Summary

    - ### Fields inherited from interface org.apache.commons.jexl3.introspection.JexlUberspect

      `JEXL_STRATEGY, MAP, MAP_STRATEGY, POJO`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SandboxUberspect(JexlUberspect theUberspect, JexlSandbox theSandbox)` A constructor for JexlSandbox uberspect.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JexlArithmetic.Uberspect` | `getArithmetic(JexlArithmetic arithmetic)` Gets an arithmetic operator resolver for a given arithmetic instance.
    `JexlMethod` | `getConstructor(Object ctorHandle, Object... args)` Returns a class constructor.
    `Iterator<?>` | `getIterator(Object obj)` Gets an iterator from an object.
    `JexlMethod` | `getMethod(Object obj, String method, Object... args)` Returns a JexlMethod.
    `JexlPropertyGet` | `getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier)` Property getter.
    `JexlPropertyGet` | `getPropertyGet(Object obj, Object identifier)` Property getter.
    `JexlPropertySet` | `getPropertySet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier, Object arg)` Property setter.
    `JexlPropertySet` | `getPropertySet(Object obj, Object identifier, Object arg)` Property setter.
    `List<JexlUberspect.PropertyResolver>` | `getResolvers(JexlOperator op, Object obj)` Applies this uberspect property resolver strategy.
    `int` | `getVersion()` Gets this uberspect version.
    `void` | `setClassLoader(ClassLoader loader)` Sets the class loader to use.

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

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

- - ### Constructor Detail

    - #### SandboxUberspect

          public SandboxUberspect(JexlUberspect theUberspect,
                          JexlSandbox theSandbox)

      A constructor for JexlSandbox uberspect.
      Parameters:
        `theUberspect` - the JexlUberspect to sandbox
        `theSandbox` - the sandbox which is copied to avoid changes at runtime

  - ### Method Detail

    - #### setClassLoader

          public void setClassLoader(ClassLoader loader)

      Sets the class loader to use.

      This increments the version.

      Specified by:
        `setClassLoader` in interface `JexlUberspect`
      Parameters:
        `loader` - the class loader

    - #### getVersion

          public int getVersion()

      Gets this uberspect version.
      Specified by:
        `getVersion` in interface `JexlUberspect`
      Returns:
        the class loader modification count

    - #### getConstructor

          public JexlMethod getConstructor(Object ctorHandle,
                                  Object... args)

      Returns a class constructor.
      Specified by:
        `getConstructor` in interface `JexlUberspect`
      Parameters:
        `ctorHandle` - a class or class name
        `args` - constructor arguments
      Returns:
        a `JexlMethod`

    - #### getMethod

          public JexlMethod getMethod(Object obj,
                             String method,
                             Object... args)

      Returns a JexlMethod.
      Specified by:
        `getMethod` in interface `JexlUberspect`
      Parameters:
        `obj` - the object
        `method` - the method name
        `args` - method arguments
      Returns:
        a `JexlMethod`

    - #### getResolvers

          public List<JexlUberspect.PropertyResolver> getResolvers(JexlOperator op,
                                                          Object obj)

      Applies this uberspect property resolver strategy.
      Specified by:
        `getResolvers` in interface `JexlUberspect`
      Parameters:
        `op` - the operator
        `obj` - the object
      Returns:
        the applied strategy resolver list

    - #### getPropertyGet

          public JexlPropertyGet getPropertyGet(Object obj,
                                       Object identifier)

      Property getter.

      returns a JelPropertySet apropos to an expression like `bar.woogie`.

      Specified by:
        `getPropertyGet` in interface `JexlUberspect`
      Parameters:
        `obj` - the object to get the property from
        `identifier` - property name
      Returns:
        a `JexlPropertyGet` or null

    - #### getPropertyGet

          public JexlPropertyGet getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers,
                                       Object obj,
                                       Object identifier)

      Property getter.

      Seeks a JexlPropertyGet apropos to an expression like `bar.woogie`.

      See `JexlUberspect.ResolverStrategy.apply(JexlOperator, java.lang.Object)`
      Specified by:
        `getPropertyGet` in interface `JexlUberspect`
      Parameters:
        `resolvers` - the list of property resolvers to try
        `obj` - the object to get the property from
        `identifier` - property name
      Returns:
        a `JexlPropertyGet` or null

    - #### getPropertySet

          public JexlPropertySet getPropertySet(Object obj,
                                       Object identifier,
                                       Object arg)

      Property setter.

      Seeks a JelPropertySet apropos to an expression like `foo.bar = "geir"`.

      Specified by:
        `getPropertySet` in interface `JexlUberspect`
      Parameters:
        `obj` - the object to get the property from.
        `identifier` - property name
        `arg` - value to set
      Returns:
        a `JexlPropertySet` or null

    - #### getPropertySet

          public JexlPropertySet getPropertySet(List<JexlUberspect.PropertyResolver> resolvers,
                                       Object obj,
                                       Object identifier,
                                       Object arg)

      Property setter.

      Seeks a JelPropertySet apropos to an expression like `foo.bar = "geir"`.

      See `JexlUberspect.ResolverStrategy.apply(JexlOperator, java.lang.Object)`
      Specified by:
        `getPropertySet` in interface `JexlUberspect`
      Parameters:
        `resolvers` - the list of property resolvers to try,
        `obj` - the object to get the property from
        `identifier` - property name
        `arg` - value to set
      Returns:
        a `JexlPropertySet` or null

    - #### getIterator

          public Iterator<?> getIterator(Object obj)

      Gets an iterator from an object.
      Specified by:
        `getIterator` in interface `JexlUberspect`
      Parameters:
        `obj` - to get the iterator from
      Returns:
        an iterator over obj or null

    - #### getArithmetic

          public JexlArithmetic.Uberspect getArithmetic(JexlArithmetic arithmetic)

      Gets an arithmetic operator resolver for a given arithmetic instance.
      Specified by:
        `getArithmetic` in interface `JexlUberspect`
      Parameters:
        `arithmetic` - the arithmetic instance
      Returns:
        the arithmetic uberspect or null if no operator method were overridden

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.