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

📄 decimalconverter.java

📁 Persistence Layer s ebook and source code.
💻 JAVA
字号:
package pl.test;import pl.converter.*;import java.util.Properties;import java.text.DecimalFormat;/** * Converts numbers from/to string with the specified pattern. */public class DecimalConverter implements Converter{    private DecimalFormat format = null;    public DecimalConverter()    {    }    public void init(Properties properties) throws pl.PlException    {        format = new DecimalFormat(properties.getProperty("format"));    }    public Object convertTo(Object object) throws pl.PlException    {        try        {            return format.parse((String)object);        }        catch(java.text.ParseException e)        {            throw pl.PlException.toPlException(e);        }    }    public Object convertFrom(Object object) throws pl.PlException    {        return format.format(object);    }}

⌨️ 快捷键说明

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