当前位置: 首页>>代码示例>>Java>>正文


Java EvaluationContext.getFunctionMapper方法代码示例

本文整理汇总了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();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:18,代码来源:AstFunction.java

示例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();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AstFunction.java

示例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();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:16,代码来源:AstFunction.java

示例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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:65,代码来源:AstFunction.java

示例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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:51,代码来源:AstFunction.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:43,代码来源:AstFunction.java


注:本文中的org.apache.el.lang.EvaluationContext.getFunctionMapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。