private final class UberspectImpl.ConstructorMethod extends java.lang.Object implements JexlMethod
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Constructor<?> |
ctor
The wrapped constructor.
|
Modifier | Constructor and Description |
---|---|
private |
ConstructorMethod(java.lang.reflect.Constructor<?> theCtor)
Creates a constructor method.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
getReturnType()
returns the return type of the method invoked.
|
java.lang.Object |
invoke(java.lang.Object obj,
java.lang.Object[] params)
Invocation method, called when the method invocation should be performed
and a value returned.
|
boolean |
isCacheable()
Specifies if this JexlMethod is cacheable and able to be reused for this
class of object it was returned for.
|
boolean |
tryFailed(java.lang.Object rval)
Checks whether a tryInvoke failed or not.
|
java.lang.Object |
tryInvoke(java.lang.String name,
java.lang.Object obj,
java.lang.Object[] params)
Attempts to reuse this JexlMethod, checking that it is compatible with
the actual set of arguments.
|
private ConstructorMethod(java.lang.reflect.Constructor<?> theCtor)
theCtor
- the constructor to wrappublic java.lang.Object invoke(java.lang.Object obj, java.lang.Object[] params) throws java.lang.Exception
invoke
in interface JexlMethod
obj
- the objectparams
- method parameters.java.lang.Exception
- on any error.public java.lang.Object tryInvoke(java.lang.String name, java.lang.Object obj, java.lang.Object[] params)
tryInvoke
in interface JexlMethod
name
- the method nameobj
- the object to invoke the method uponparams
- the method argumentspublic boolean tryFailed(java.lang.Object rval)
tryFailed
in interface JexlMethod
rval
- the value returned by tryInvokepublic boolean isCacheable()
isCacheable
in interface JexlMethod
public java.lang.Class<?> getReturnType()
getReturnType
in interface JexlMethod