org.apache.commons.jexl2.introspection
Class SandboxUberspectImpl

java.lang.Object
  extended by org.apache.commons.jexl2.internal.Introspector
      extended by org.apache.commons.jexl2.introspection.UberspectImpl
          extended by org.apache.commons.jexl2.introspection.SandboxUberspectImpl
All Implemented Interfaces:
Uberspect

public class SandboxUberspectImpl
extends UberspectImpl

An uberspect that controls usage of properties, methods and contructors through a sandbox.

Since:
2.1

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.jexl2.introspection.UberspectImpl
UberspectImpl.FieldPropertyGet, UberspectImpl.FieldPropertySet, UberspectImpl.IndexedContainer
 
Field Summary
protected  Sandbox sandbox
          The sandbox.
 
Fields inherited from class org.apache.commons.jexl2.introspection.UberspectImpl
TRY_FAILED
 
Fields inherited from class org.apache.commons.jexl2.internal.Introspector
rlog
 
Constructor Summary
SandboxUberspectImpl(org.apache.commons.logging.Log runtimeLogger, Sandbox theSandbox)
          A constructor for Sandbox uberspect.
 
Method Summary
 JexlMethod getConstructorMethod(Object ctorHandle, Object[] args, JexlInfo info)
          Returns a class constructor wrapped in a JexlMethod.
 JexlMethod getMethod(Object obj, String method, Object[] args, JexlInfo info)
          Returns a JexlMethod.
 JexlPropertyGet getPropertyGet(Object obj, Object identifier, JexlInfo info)
          Property getter.
 JexlPropertySet getPropertySet(Object obj, Object identifier, Object arg, JexlInfo info)
          Property setter.
 void setLoader(ClassLoader cloader)
          Resets this Uberspect class loader.
 
Methods inherited from class org.apache.commons.jexl2.introspection.UberspectImpl
getConstructor, getField, getIndexedGet, getIterator
 
Methods inherited from class org.apache.commons.jexl2.internal.Introspector
base, getClassByName, getConstructor, getField, getFieldNames, getGetExecutor, getMethod, getMethod, getMethodExecutor, getMethodNames, getMethods, getSetExecutor, setClassLoader, toInteger, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jexl2.introspection.Uberspect
setClassLoader
 

Field Detail

sandbox

protected final Sandbox sandbox
The sandbox.

Constructor Detail

SandboxUberspectImpl

public SandboxUberspectImpl(org.apache.commons.logging.Log runtimeLogger,
                            Sandbox theSandbox)
A constructor for Sandbox uberspect.

Parameters:
runtimeLogger - the logger to use or null to use default
theSandbox - the sandbox instance to use
Method Detail

setLoader

public void setLoader(ClassLoader cloader)
Resets this Uberspect class loader.

Overrides:
setLoader in class UberspectImpl
Parameters:
cloader - the class loader to use

getConstructorMethod

public JexlMethod getConstructorMethod(Object ctorHandle,
                                       Object[] args,
                                       JexlInfo info)
Returns a class constructor wrapped in a JexlMethod.

Specified by:
getConstructorMethod in interface Uberspect
Overrides:
getConstructorMethod in class UberspectImpl
Parameters:
ctorHandle - a class or class name
args - constructor arguments
info - contextual information
Returns:
a Constructor

getMethod

public JexlMethod getMethod(Object obj,
                            String method,
                            Object[] args,
                            JexlInfo info)
Returns a JexlMethod.

Specified by:
getMethod in interface Uberspect
Overrides:
getMethod in class UberspectImpl
Parameters:
obj - the object
method - the method name
args - method arguments
info - contextual information
Returns:
a JexlMethod

getPropertyGet

public JexlPropertyGet getPropertyGet(Object obj,
                                      Object identifier,
                                      JexlInfo info)
Property getter.

Returns JexlPropertyGet appropos for ${bar.woogie}.

Specified by:
getPropertyGet in interface Uberspect
Overrides:
getPropertyGet in class UberspectImpl
Parameters:
obj - the object to get the property from
identifier - property name
info - contextual information
Returns:
a JexlPropertyGet

getPropertySet

public JexlPropertySet getPropertySet(Object obj,
                                      Object identifier,
                                      Object arg,
                                      JexlInfo info)
Property setter.

returns JelPropertySet appropos for ${foo.bar = "geir"}

.

Specified by:
getPropertySet in interface Uberspect
Overrides:
getPropertySet in class UberspectImpl
Parameters:
obj - the object to get the property from.
identifier - property name
arg - value to set
info - contextual information
Returns:
a JexlPropertySet.


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.