public abstract class JavaInvoker extends AbstractJavaMethod
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.Method |
_method |
_bindingClass, _declaringClassName, _isClosure, _isConstructor, _isFinal, _isStatic, _isTraitMethod, _parseIndex, _visibility, NULL_ARGS
NULL_VALUE_ARRAY
Constructor and Description |
---|
JavaInvoker(ModuleContext moduleContext,
JavaClassDef classDef,
java.lang.reflect.Method method)
Creates the statically introspected function.
|
JavaInvoker(ModuleContext moduleContext,
JavaClassDef classDef,
java.lang.reflect.Method method,
java.lang.String name,
java.lang.Class<?>[] param,
java.lang.annotation.Annotation[][] paramAnn,
java.lang.annotation.Annotation[] methodAnn,
java.lang.Class<?> retType)
Creates the statically introspected function.
|
Modifier and Type | Method and Description |
---|---|
Value |
call(Env env,
Value[] args)
Evaluates the function.
|
Value |
callMethod(Env env,
QuercusClass qClass,
Value qThis,
Value[] args)
Evaluates the method call.
|
Value |
callMethodRef(Env env,
QuercusClass qClass,
Value qThis,
Value[] args)
Evaluates the method call, returning a reference.
|
Value |
callNew(Env env,
QuercusClass qClass,
Value qThis,
Value[] args)
Evaluates the new() method call.
|
Value[] |
evalArguments(Env env,
Expr fun,
Expr[] args)
Evaluates a function's argument, handling ref vs non-ref
|
ClassDef |
getDeclaringClass()
Returns the implementing class.
|
protected Expr[] |
getDefaultExprs()
Returns the default expressions.
|
static java.lang.String |
getFunctionName(java.lang.reflect.Method method) |
boolean |
getHasEnv()
Returns true if the environment is an argument.
|
boolean |
getHasRestArgs()
Returns true if the environment has rest-style arguments.
|
java.lang.Class<?> |
getJavaDeclaringClass() |
Marshal[] |
getMarshalArgs()
Returns the marshal arguments.
|
int |
getMarshalingCost(Expr[] args) |
int |
getMarshalingCost(Value[] args)
Returns the cost of marshaling for this method.
|
int |
getMaxArgLength()
Returns the maximum number of arguments allowed.
|
protected java.lang.annotation.Annotation[] |
getMethodAnn()
Returns the parameter annotations.
|
int |
getMinArgLength()
Returns the minimally required number of arguments.
|
java.lang.String |
getName() |
protected java.lang.annotation.Annotation[][] |
getParamAnn()
Returns the parameter annotations.
|
Marshal |
getUnmarshalReturn()
Returns the unmarshaller for the return
|
void |
init() |
abstract java.lang.Object |
invoke(java.lang.Object obj,
java.lang.Object[] args) |
boolean |
isBoolean()
Returns true if the result is a boolean.
|
boolean |
isCallUsesSymbolTable()
Returns true if the call uses the symbol table
|
boolean |
isCallUsesVariableArgs()
Returns true if the call uses variable arguments.
|
boolean |
isDouble()
Returns true if the result is a double.
|
boolean |
isLong()
Returns true if the result is a long.
|
boolean |
isRestReference()
Returns true if the rest argument is a reference.
|
boolean |
isString()
Returns true if the result is a string.
|
call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, getJavaParameterTypes, isJavaMethod, overload
callClosure, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, errorPrivateAccess, errorProtectedAccess, getActualFunction, getArgs, getBindingClass, getBindingClassName, getCallbackName, getClosureUseArgs, getComment, getCompilationName, getDeclaringClassName, getDeclComment, getDeclEndLine, getDeclFileName, getDeclStartLine, getLocation, getType, isAbstract, isCallable, isClosure, isConstructor, isFinal, isGlobal, isInternal, isObject, isPrivate, isProtected, isPublic, isReturnsReference, isStatic, isTraitMethod, isValid, setBindingClass, setClosure, setClosureUseArgs, setConstructor, setDeclaringClassName, setFinal, setGlobal, setParseIndex, setStatic, setTraitMethod, setVisibility, toFun, toString
callArray, callArray, callArray, toCallable
abs, add, add, addOne, append, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, charValueAt, checkPrivate, checkProtected, clone, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eq, eql, eqValue, findFunction, findQuercusClass, generate, geq, get, get, getArg, getArgTail, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getObjectHash, getQuercusClass, getRef, getResourceType, getSize, getStaticFieldValue, getStaticFieldVar, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getValueType, getVar, gt, hasCurrent, hashCode, increment, initField, initField, initField, initIncompleteField, isA, isA, isArray, isBinary, isDefault, isDoubleConvertible, isEmpty, isEmpty, isFieldExists, isFieldInit, isLongConvertible, isNull, isNumberConvertible, isNumeric, isResource, isset, isset, issetField, issetThisField, isUnicode, isVar, jsonEncode, key, keyExists, length, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putArray, putField, putField, putField, putObject, putThisField, putThisField, putThisFieldArray, putVar, remove, reset, rshift, serialize, serialize, set, setCharValueAt, setFieldInit, setJavaObject, setStaticFieldRef, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBoolean, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDouble, toDouble, toDouble, toDouble, toDouble, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaEnum, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toKey, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLong, toLong, toLong, toLong, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, unsetThisPrivateField, valuesToArray, varDump, varDumpImpl, varExport, varExportImpl
public JavaInvoker(ModuleContext moduleContext, JavaClassDef classDef, java.lang.reflect.Method method, java.lang.String name, java.lang.Class<?>[] param, java.lang.annotation.Annotation[][] paramAnn, java.lang.annotation.Annotation[] methodAnn, java.lang.Class<?> retType)
public JavaInvoker(ModuleContext moduleContext, JavaClassDef classDef, java.lang.reflect.Method method)
public static java.lang.String getFunctionName(java.lang.reflect.Method method)
public void init()
public ClassDef getDeclaringClass()
getDeclaringClass
in class AbstractFunction
public int getMinArgLength()
getMinArgLength
in class AbstractJavaMethod
public int getMaxArgLength()
getMaxArgLength
in class AbstractJavaMethod
public java.lang.Class<?> getJavaDeclaringClass()
getJavaDeclaringClass
in class AbstractJavaMethod
public boolean getHasEnv()
public boolean getHasRestArgs()
getHasRestArgs
in class AbstractJavaMethod
public boolean isRestReference()
public Marshal getUnmarshalReturn()
public boolean isCallUsesVariableArgs()
isCallUsesVariableArgs
in class AbstractFunction
public boolean isCallUsesSymbolTable()
isCallUsesSymbolTable
in class AbstractFunction
public boolean isBoolean()
isBoolean
in class AbstractFunction
public boolean isString()
isString
in class AbstractFunction
public boolean isLong()
isLong
in class AbstractFunction
public boolean isDouble()
isDouble
in class AbstractFunction
public java.lang.String getName()
getName
in class AbstractFunction
public Marshal[] getMarshalArgs()
protected java.lang.annotation.Annotation[][] getParamAnn()
protected java.lang.annotation.Annotation[] getMethodAnn()
protected Expr[] getDefaultExprs()
public Value[] evalArguments(Env env, Expr fun, Expr[] args)
evalArguments
in class AbstractFunction
args
- the user's argumentspublic int getMarshalingCost(Value[] args)
getMarshalingCost
in class AbstractJavaMethod
public int getMarshalingCost(Expr[] args)
getMarshalingCost
in class AbstractJavaMethod
public Value call(Env env, Value[] args)
AbstractFunction
call
in interface Callable
call
in class AbstractJavaMethod
env
- the calling environmentpublic Value callMethodRef(Env env, QuercusClass qClass, Value qThis, Value[] args)
AbstractFunction
callMethodRef
in class AbstractFunction
public Value callMethod(Env env, QuercusClass qClass, Value qThis, Value[] args)
AbstractFunction
callMethod
in class AbstractJavaMethod
public Value callNew(Env env, QuercusClass qClass, Value qThis, Value[] args)
AbstractFunction
callNew
in class AbstractFunction
public abstract java.lang.Object invoke(java.lang.Object obj, java.lang.Object[] args)