⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simplelongconverter.java

📁 pojo的mvc框架
💻 JAVA
字号:
package xyz.frame.converter.basic;import xyz.frame.LogicRequest;import xyz.frame.converter.ConversionException;import xyz.frame.converter.Converter;/** * Simple long converter. * Uses the error key invalid_time if unable to parse its information. *  * @author Guilherme Silveira */public class SimpleLongConverter implements Converter {	public Object convert(String value, Class<?> type, LogicRequest context)			throws ConversionException {		if (value == null || value.equals("")) {			return null;		}		try {			return Long.valueOf(value);		} catch (NumberFormatException e) {			throw new ConversionException("invalid_number", e.getMessage(), e);		}	}	/**	 * Returns the list of supported types	 * 	 * @see xyz.frame.converter.Converter#getSupportedTypes()	 */	public Class<?>[] getSupportedTypes() {		return new Class[] { Long.class };	}}

⌨️ 快捷键说明

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