apacheelfactory.java

来自「ZK 基础介绍 功能操作 模块 结合数据库操作」· Java 代码 · 共 67 行

JAVA
67
字号
/* ApacheELFactory.java{{IS_NOTE	Purpose:			Description:			History:		Thu Aug 30 11:12:14     2007, Created by tomyeh}}IS_NOTECopyright (C) 2007 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zkmax.xel.el21;import javax.el.ELContext;import org.zkoss.xel.Expression;import org.zkoss.xel.ExpressionFactory;import org.zkoss.xel.XelContext;import org.zkoss.xel.XelException;/** * An implementation based on org.apache.el.ExpressionFactoryImpl. * * @author tomyeh * @since 3.0.0 */public class ApacheELFactory implements ExpressionFactory {	private final javax.el.ExpressionFactory _expf;	public ApacheELFactory() {		_expf = newExpressionFactory();	}	//ExpressionFactory//	public boolean isSupported(int feature) {		return feature == FEATURE_FUNCTION;	}	public Expression parseExpression(XelContext xelc, String expression,	Class expectedType)	throws XelException {		return new ELXelExpression(			_expf.createValueExpression(				new XelELContext(xelc), expression, expectedType));	}	public Object evaluate(XelContext xelc, String expression,	Class expectedType)	throws XelException {		final ELContext ctx = new XelELContext(xelc);		return _expf.createValueExpression(				ctx, expression, expectedType).getValue(ctx);	}	/** Returns the EL expression factory.	 * <p>Default: Use org.apache.el.ExpressionFactoryImpl.	 * <p>You might override it to use a different implementation.	 */	protected javax.el.ExpressionFactory newExpressionFactory() {		return new org.apache.el.ExpressionFactoryImpl();	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?