org.apache.commons.jexl3.internal.introspection
Class SandboxUberspect

java.lang.Object
  extended by org.apache.commons.jexl3.internal.Introspector
      extended by org.apache.commons.jexl3.internal.introspection.Uberspect
          extended by org.apache.commons.jexl3.internal.introspection.SandboxUberspect
All Implemented Interfaces:
Uberspect

public class SandboxUberspect
extends Uberspect

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

Since:
3.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.jexl3.internal.introspection.Uberspect
Uberspect.IndexedContainer
 
Field Summary
protected  Sandbox sandbox
          The sandbox.
 
Fields inherited from class org.apache.commons.jexl3.internal.introspection.Uberspect
TRY_FAILED
 
Fields inherited from class org.apache.commons.jexl3.internal.Introspector
rlog
 
Constructor Summary
SandboxUberspect(org.apache.commons.logging.Log runtimeLogger, Sandbox theSandbox)
          A constructor for Sandbox uberspect.
 
Method Summary
 JexlMethod getConstructor(Object ctorHandle, Object[] args, JexlInfo.Handle info)
          Returns a class constructor.
 JexlMethod getMethod(Object obj, String method, Object[] args, JexlInfo.Handle info)
          Returns a JexlMethod.
 JexlPropertyGet getPropertyGet(Object obj, Object identifier, JexlInfo.Handle info)
          Property getter.

Returns JexlPropertyGet appropos for ${bar.woogie}.

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

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

.
 void setLoader(ClassLoader cloader)
          Resets this Uberspect class loader.
 
Methods inherited from class org.apache.commons.jexl3.internal.introspection.Uberspect
getField, getIndexedGet, getIterator
 
Methods inherited from class org.apache.commons.jexl3.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.jexl3.introspection.Uberspect
setClassLoader
 

Field Detail

sandbox

protected final Sandbox sandbox
The sandbox.

Constructor Detail

SandboxUberspect

public SandboxUberspect(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 Uberspect
Parameters:
cloader - the class loader to use

getConstructor

public JexlMethod getConstructor(Object ctorHandle,
                                 Object[] args,
                                 JexlInfo.Handle info)
Returns a class constructor.

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

getMethod

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

Specified by:
getMethod in interface Uberspect
Overrides:
getMethod in class Uberspect
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.Handle info)
Property getter.

Returns JexlPropertyGet appropos for ${bar.woogie}.

Specified by:
getPropertyGet in interface Uberspect
Overrides:
getPropertyGet in class Uberspect
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.Handle info)
Property setter.

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

.

Specified by:
getPropertySet in interface Uberspect
Overrides:
getPropertySet in class Uberspect
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.