funcmapper.java

来自「ZK是一个Ajax Java Web框架」· Java 代码 · 共 49 行

JAVA
49
字号
/* FuncMapper.java{{IS_NOTE	Purpose:			Description:			History:		Mon May  5 15:57:33     2008, Created by tomyeh}}IS_NOTECopyright (C) 2008 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.zkdemo.test2;import org.zkoss.xel.Function;import org.zkoss.xel.XelException;import org.zkoss.xel.util.MethodFunction;import org.zkoss.xel.util.SimpleMapper;/** * Used to test with test2/Z31-funcmap.zul * * @author tomyeh */public class FuncMapper extends SimpleMapper {	public Function resolveFunction(String prefix, String name)	throws XelException {		if ("quote".equals(name)) {			try {				return new MethodFunction(					FuncMapper.class.getMethod("quote", new Class[] {String.class}));			} catch (Exception ex) {				throw XelException.Aide.wrap(ex);			}		}		return null;	}	public static String quote(String s){		return "'" + s +"'";	}}

⌨️ 快捷键说明

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