Package org.nutz.el.opt.custom

Source Code of org.nutz.el.opt.custom.Trim

package org.nutz.el.opt.custom;

import java.util.List;

import org.nutz.el.ElException;
import org.nutz.el.opt.RunMethod;
import org.nutz.plugin.Plugin;

/**
* 去掉字符串两边的空格
* @author juqkai(juqkai@gmail.com)
*
*/
public class Trim implements RunMethod, Plugin{
    public Object run(List<Object> fetchParam) {
        if(fetchParam.size() <= 0){
            throw new ElException("trim方法参数错误");
        }
        String obj = (String) fetchParam.get(0);
        return obj.trim();
    }

    public boolean canWork() {
        return true;
    }

    public String fetchSelf() {
        return "trim";
    }
}
TOP

Related Classes of org.nutz.el.opt.custom.Trim

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.