All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tinygroup.menucommand.function.QueryTemplateFunction Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.tinygroup.menucommand.function;

import org.tinygroup.template.Template;
import org.tinygroup.template.TemplateContext;
import org.tinygroup.template.TemplateException;
import org.tinygroup.template.function.AbstractTemplateFunction;

/**
 * 查询菜单的关键字函数
 * @author yancheng11334
 *
 */
public class QueryTemplateFunction extends AbstractTemplateFunction{

	public String getBindingTypes() {
        return "java.lang.String";
    }
	
	public QueryTemplateFunction() {
		super("query");
	}

	public Object execute(Template template, TemplateContext context,
			Object... parameters) throws TemplateException {
		String value = (String)parameters[0];
		String key = (String)parameters[1];
		if(value!=null && key!=null && value.indexOf(key)>-1){
		   return true;
		}
		return false;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy