本文整理汇总了Java中javax.el.FunctionMapper类的典型用法代码示例。如果您正苦于以下问题:Java FunctionMapper类的具体用法?Java FunctionMapper怎么用?Java FunctionMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FunctionMapper类属于javax.el包,在下文中一共展示了FunctionMapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildEvaluationContext
import javax.el.FunctionMapper; //导入依赖的package包/类
public static EvaluationContext buildEvaluationContext(
Map<String, Method> functionMethodMap,
Map<String, Object> attributeMap) {
VariableMapper vMapper = buildVariableMapper(attributeMap);
FunctionMapper fMapper = buildFunctionMapper(functionMethodMap);
EsfingeELContext context = new EsfingeELContext(fMapper, vMapper,
new ArrayELResolver(), new ListELResolver(), new MapELResolver(), new BeanELResolver());
return new EvaluationContext(context, fMapper, vMapper);
}
示例2: createELContext
import javax.el.FunctionMapper; //导入依赖的package包/类
private ELContext createELContext(final ELResolver resolver, final FunctionMapper functionMapper, final VariableMapper variableMapper) {
return new ELContext() {
@Override
public ELResolver getELResolver() {
return resolver;
}
@Override
public FunctionMapper getFunctionMapper() {
return functionMapper;
}
@Override
public VariableMapper getVariableMapper() {
return variableMapper;
}
};
}
示例3: getType
import javax.el.FunctionMapper; //导入依赖的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: getType
import javax.el.FunctionMapper; //导入依赖的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();
}
示例5: ValueExpressionImpl
import javax.el.FunctionMapper; //导入依赖的package包/类
/**
*
*/
public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
VariableMapper varMapper, Class expectedType) {
this.expr = expr;
this.node = node;
this.fnMapper = fnMapper;
this.varMapper = varMapper;
this.expectedType = expectedType;
}
示例6: validateExpressions
import javax.el.FunctionMapper; //导入依赖的package包/类
/**
* Validates the syntax of all ${} expressions within the given string.
* @param where the approximate location of the expressions in the JSP page
* @param expressions a string containing zero or more "${}" expressions
* @param err an error dispatcher to use
* @deprecated now delegated to the org.apache.el Package
*/
public static void validateExpressions(Mark where,
String expressions,
Class expectedType,
FunctionMapper functionMapper,
ErrorDispatcher err)
throws JasperException {
// try {
//
// JspUtil.expressionEvaluator.parseExpression( expressions,
// expectedType, functionMapper );
// }
// catch( ELParseException e ) {
// err.jspError(where, "jsp.error.invalid.expression", expressions,
// e.toString() );
// }
// catch( ELException e ) {
// err.jspError(where, "jsp.error.invalid.expression", expressions,
// e.toString() );
// }
}
示例7: ExpressionBuilder
import javax.el.FunctionMapper; //导入依赖的package包/类
/**
*
*/
public ExpressionBuilder(String expression, ELContext ctx)
throws ELException {
this.expression = expression;
FunctionMapper ctxFn = ctx.getFunctionMapper();
VariableMapper ctxVar = ctx.getVariableMapper();
if (ctxFn != null) {
this.fnMapper = new FunctionMapperFactory(ctxFn);
}
if (ctxVar != null) {
this.varMapper = new VariableMapperFactory(ctxVar);
}
}
示例8: CdiResolver
import javax.el.FunctionMapper; //导入依赖的package包/类
public CdiResolver() {
context = new javax.el.ELContext() {
@Override
public VariableMapper getVariableMapper() {
return null;
}
@Override
public FunctionMapper getFunctionMapper() {
return null;
}
@Override
public javax.el.ELResolver getELResolver() {
return getWrappedResolver();
}
};
}
示例9: getMethodExpression
import javax.el.FunctionMapper; //导入依赖的package包/类
public static MethodExpression getMethodExpression(
String expression,
PageContext pageContext,
FunctionMapper functionMap,
Class expectedType,
Class[] paramTypes) {
ELContextImpl elctxt = (ELContextImpl)pageContext.getELContext();
elctxt.setFunctionMapper(functionMap);
ExpressionFactory expFactory = getExpressionFactory(pageContext);
return expFactory.createMethodExpression(
elctxt,
expression,
expectedType,
paramTypes);
}
示例10: validateExpressions
import javax.el.FunctionMapper; //导入依赖的package包/类
/**
* Validates the syntax of all EL expressions within the given string.
* @param where the approximate location of the expressions in the JSP page
* @param expressions a string containing an EL expressions
* @param err an error dispatcher to use
*/
public static void validateExpressions(Mark where,
String expressions,
FunctionMapper functionMapper,
ErrorDispatcher err)
throws JasperException {
try {
ELContextImpl elContext = new ELContextImpl(null);
elContext.setFunctionMapper(functionMapper);
getExpressionFactory().createValueExpression(
elContext,
expressions, Object.class);
}
catch( ELException e ) {
err.jspError(where, "jsp.error.invalid.expression", expressions,
e.toString() );
}
}
示例11: CdiResolver
import javax.el.FunctionMapper; //导入依赖的package包/类
public CdiResolver() {
context = new javax.el.ELContext() {
@Override
public VariableMapper getVariableMapper() {
return null;
}
@Override
public FunctionMapper getFunctionMapper() {
return null;
}
@Override
public javax.el.ELResolver getELResolver() {
return getWrappedResolver();
}
};
}
示例12: ValueExpressionImpl
import javax.el.FunctionMapper; //导入依赖的package包/类
/**
*
*/
public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
VariableMapper varMapper, Class<?> expectedType) {
this.expr = expr;
this.node = node;
this.fnMapper = fnMapper;
this.varMapper = varMapper;
this.expectedType = expectedType;
}
示例13: createELContext
import javax.el.FunctionMapper; //导入依赖的package包/类
private ExtendedELContext createELContext(final ELResolver resolver, final FunctionMapper functionMapper,
final VariableMapper variableMapper, final ConstantResolver constantResolver) {
return new ExtendedELContext() {
@Override
public ELResolver getELResolver() {
return resolver;
}
@Override
public FunctionMapper getFunctionMapper() {
return functionMapper;
}
@Override
public VariableMapper getVariableMapper() {
return variableMapper;
}
@Override
public ConstantResolver getConstantResolver() {
return constantResolver;
}
};
}
示例14: getType
import javax.el.FunctionMapper; //导入依赖的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();
}
示例15: getValue
import javax.el.FunctionMapper; //导入依赖的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()));
}
// If no params, there are no children, jjtGetNumChildren returns 0 if no children, not NPE
Object[] params = new Object[this.jjtGetNumChildren()];
for (int i = 0; i < this.jjtGetNumChildren(); i++) {
params[i] = this.children[i].getValue(ctx);
}
return ReflectionUtil.invokeMethod(null, m, params);
}