📄 quercusclass.java
字号:
* calls the function. */ public Value callMethod(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethod(env, thisValue, a1); else if (getCall() != null) { return getCall().callMethod(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethod(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethod(env, thisValue, a1, a2); else if (getCall() != null) { return getCall().callMethod(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethod(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethod(env, thisValue, a1, a2, a3); else if (getCall() != null) { return getCall().callMethod(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethod(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3, Value a4) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethod(env, thisValue, a1, a2, a3, a4); else if (getCall() != null) { return getCall().callMethod(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3) .append(a4)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethod(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3, Value a4, Value a5) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethod(env, thisValue, a1, a2, a3, a4, a5); else if (getCall() != null) { return getCall().callMethod(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3) .append(a4) .append(a5)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Expr []args) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = getFunction(hash, name, nameLen); return fun.callMethodRef(env, thisValue, args); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, StringValue methodName, Expr []args) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(methodName.toString()); if (fun != null) return fun.callMethodRef(env, thisValue, args); else if (getCall() != null) { Expr []newArgs = new Expr[args.length + 1]; newArgs[0] = new StringLiteralExpr(methodName.toString()); System.arraycopy(args, 0, newArgs, 1, args.length); return getCall().callMethodRef(env, thisValue, newArgs); } else return env.error(L.l("Call to undefined method {0}::{1}", getName(), methodName)); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value []args) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, args); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl(args)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, StringValue name, Value []args) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(name.toString()); if (fun != null) return fun.callMethodRef(env, thisValue, args); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, name, new ArrayValueImpl(args)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), name)); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl()); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, a1); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, a1, a2); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, a1, a2, a3); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3, Value a4) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, a1, a2, a3, a4); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3) .append(a4)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } /** * calls the function. */ public Value callMethodRef(Env env, Value thisValue, int hash, char []name, int nameLen, Value a1, Value a2, Value a3, Value a4, Value a5) { String oldClassName = env.setCallingClassName(_className); try { AbstractFunction fun = _methodMap.get(hash, name, nameLen); if (fun != null) return fun.callMethodRef(env, thisValue, a1, a2, a3, a4, a5); else if (getCall() != null) { return getCall().callMethodRef(env, thisValue, env.createString(name, nameLen), new ArrayValueImpl() .append(a1) .append(a2) .append(a3) .append(a4) .append(a5)); } else return env.error(L.l("Call to undefined method {0}::{1}()", getName(), toMethod(name, nameLen))); } finally { env.setCallingClassName(oldClassName); } } private String toMethod(char []key, int keyLength) { return new String(key, 0, keyLength); } /** * Finds a function. */ public AbstractFunction findStaticFunctionLowerCase(String name) { return null; } /** * Finds the matching function. */ public final AbstractFunction getStaticFunction(String name) { AbstractFunction fun = findStaticFunction(name); /* if (fun != null) return fun; fun = findStaticFunctionLowerCase(name.toLowerCase()); */ if (fun != null) return fun; else { throw new QuercusRuntimeException(L.l("{0}::{1} is an unknown method", getName(), name)); } } /** * Finds the matching constant */ public final Value getConstant(Env env, String name) { Expr expr = _constMap.get(name); if (expr != null) return expr.eval(env); throw new QuercusRuntimeException(L.l("{0}::{1} is an unknown constant", getName(), name)); } /** * Returns true if the constant exists. */ public final boolean hasConstant(String name) { return _constMap.get(String.valueOf(name)) != null; } /* * Returns the constants defined in this class. */ public final HashMap<String, Expr> getConstantMap() { return _constMap; } public String toString() { return getClass().getSimpleName() + "[" + getName() + "]"; } static class StaticField { String _name; Expr _expr; StaticField(String name, Expr expr) { _name = name; _expr = expr; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -