本文整理汇总了Java中org.apache.el.lang.EvaluationContext.getFunctionMapper方法的典型用法代码示例。如果您正苦于以下问题:Java EvaluationContext.getFunctionMapper方法的具体用法?Java EvaluationContext.getFunctionMapper怎么用?Java EvaluationContext.getFunctionMapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.el.lang.EvaluationContext
的用法示例。
在下文中一共展示了EvaluationContext.getFunctionMapper方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getType
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method",
this.getOutputName()));
}
return m.getReturnType();
}
示例2: getType
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
public Class getType(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method",
this.getOutputName()));
}
return m.getReturnType();
}
示例3: getType
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method", this.getOutputName()));
}
return m.getReturnType();
}
示例4: getValue
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method", this.getOutputName()));
}
Class<?>[] paramTypes = m.getParameterTypes();
Object[] params = null;
Object result = null;
int inputParameterCount = this.jjtGetNumChildren();
int methodParameterCount = paramTypes.length;
if (inputParameterCount == 0 && methodParameterCount == 1 && m.isVarArgs()) {
params = new Object[] { null };
} else if (inputParameterCount > 0) {
params = new Object[methodParameterCount];
try {
for (int i = 0; i < methodParameterCount; i++) {
if (m.isVarArgs() && i == methodParameterCount - 1) {
if (inputParameterCount < methodParameterCount) {
params[i] = new Object[] { null };
} else if (inputParameterCount == methodParameterCount && paramTypes[i].isArray()) {
params[i] = this.jjtGetChild(i).getValue(ctx);
} else {
Object[] varargs = new Object[inputParameterCount - methodParameterCount + 1];
Class<?> target = paramTypes[i].getComponentType();
for (int j = i; j < inputParameterCount; j++) {
varargs[j - i] = this.jjtGetChild(j).getValue(ctx);
varargs[j - i] = coerceToType(varargs[j - i], target);
}
params[i] = varargs;
}
} else {
params[i] = this.jjtGetChild(i).getValue(ctx);
}
params[i] = coerceToType(params[i], paramTypes[i]);
}
} catch (ELException ele) {
throw new ELException(MessageFactory.get("error.function", this.getOutputName()), ele);
}
}
try {
result = m.invoke(null, params);
} catch (IllegalAccessException iae) {
throw new ELException(MessageFactory.get("error.function", this.getOutputName()), iae);
} catch (InvocationTargetException ite) {
Throwable cause = ite.getCause();
if (cause instanceof ThreadDeath) {
throw (ThreadDeath) cause;
}
if (cause instanceof VirtualMachineError) {
throw (VirtualMachineError) cause;
}
throw new ELException(MessageFactory.get("error.function", this.getOutputName()), cause);
}
return result;
}
示例5: getValue
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method",
this.getOutputName()));
}
Class<?>[] paramTypes = m.getParameterTypes();
Object[] params = null;
Object result = null;
int numParams = this.jjtGetNumChildren();
if (numParams > 0) {
params = new Object[numParams];
try {
for (int i = 0; i < numParams; i++) {
params[i] = this.children[i].getValue(ctx);
params[i] = coerceToType(params[i], paramTypes[i]);
}
} catch (ELException ele) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), ele);
}
}
try {
result = m.invoke(null, params);
} catch (IllegalAccessException iae) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), iae);
} catch (InvocationTargetException ite) {
Throwable cause = ite.getCause();
if (cause instanceof ThreadDeath) {
throw (ThreadDeath) cause;
}
if (cause instanceof VirtualMachineError) {
throw (VirtualMachineError) cause;
}
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), cause);
}
return result;
}
示例6: getValue
import org.apache.el.lang.EvaluationContext; //导入方法依赖的package包/类
public Object getValue(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method",
this.getOutputName()));
}
Class[] paramTypes = m.getParameterTypes();
Object[] params = null;
Object result = null;
int numParams = this.jjtGetNumChildren();
if (numParams > 0) {
params = new Object[numParams];
try {
for (int i = 0; i < numParams; i++) {
params[i] = this.children[i].getValue(ctx);
params[i] = coerceToType(params[i], paramTypes[i]);
}
} catch (ELException ele) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), ele);
}
}
try {
result = m.invoke(null, params);
} catch (IllegalAccessException iae) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), iae);
} catch (InvocationTargetException ite) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), ite.getCause());
}
return result;
}