Class SandboxUberspectImpl
- java.lang.Object
-
- org.apache.commons.jexl2.internal.Introspector
-
- org.apache.commons.jexl2.introspection.UberspectImpl
-
- 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
Fields Modifier and Type Field Description 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
Constructors Constructor Description SandboxUberspectImpl(org.apache.commons.logging.Log runtimeLogger, Sandbox theSandbox)
A constructor for Sandbox uberspect.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JexlMethod
getConstructorMethod(java.lang.Object ctorHandle, java.lang.Object[] args, JexlInfo info)
Returns a class constructor wrapped in a JexlMethod.JexlMethod
getMethod(java.lang.Object obj, java.lang.String method, java.lang.Object[] args, JexlInfo info)
Returns a JexlMethod.JexlPropertyGet
getPropertyGet(java.lang.Object obj, java.lang.Object identifier, JexlInfo info)
Property getter.JexlPropertySet
getPropertySet(java.lang.Object obj, java.lang.Object identifier, java.lang.Object arg, JexlInfo info)
Property setter.void
setLoader(java.lang.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 defaulttheSandbox
- the sandbox instance to use
-
-
Method Detail
-
setLoader
public void setLoader(java.lang.ClassLoader cloader)
Resets this Uberspect class loader.- Overrides:
setLoader
in classUberspectImpl
- Parameters:
cloader
- the class loader to use
-
getConstructorMethod
public JexlMethod getConstructorMethod(java.lang.Object ctorHandle, java.lang.Object[] args, JexlInfo info)
Returns a class constructor wrapped in a JexlMethod.- Specified by:
getConstructorMethod
in interfaceUberspect
- Overrides:
getConstructorMethod
in classUberspectImpl
- Parameters:
ctorHandle
- a class or class nameargs
- constructor argumentsinfo
- contextual information- Returns:
- a
Constructor
-
getMethod
public JexlMethod getMethod(java.lang.Object obj, java.lang.String method, java.lang.Object[] args, JexlInfo info)
Returns a JexlMethod.- Specified by:
getMethod
in interfaceUberspect
- Overrides:
getMethod
in classUberspectImpl
- Parameters:
obj
- the objectmethod
- the method nameargs
- method argumentsinfo
- contextual information- Returns:
- a
JexlMethod
-
getPropertyGet
public JexlPropertyGet getPropertyGet(java.lang.Object obj, java.lang.Object identifier, JexlInfo info)
Property getter.Returns JexlPropertyGet appropos for ${bar.woogie}.
- Specified by:
getPropertyGet
in interfaceUberspect
- Overrides:
getPropertyGet
in classUberspectImpl
- Parameters:
obj
- the object to get the property fromidentifier
- property nameinfo
- contextual information- Returns:
- a
JexlPropertyGet
-
getPropertySet
public JexlPropertySet getPropertySet(java.lang.Object obj, java.lang.Object identifier, java.lang.Object arg, JexlInfo info)
Property setter.returns JelPropertySet appropos for ${foo.bar = "geir"}
.- Specified by:
getPropertySet
in interfaceUberspect
- Overrides:
getPropertySet
in classUberspectImpl
- Parameters:
obj
- the object to get the property from.identifier
- property namearg
- value to setinfo
- contextual information- Returns:
- a
JexlPropertySet
.
-
-