charconverter.java

来自「jConfig,JAVA读取XML的开源项目」· Java 代码 · 共 34 行

JAVA
34
字号
/*
 * CharPropertyEditor.java
 *
 * Created on 28. September 2004, 13:10
 */

package org.jconfig.utils.editors;

/**
 * The CharConverter will convert the given text into a Character object.
 * It simply takes the first char of the text and returns this as Character.
 *
 * @author  Andreas Mecky andreasmecky@yahoo.de
 * @author  Terry Dye terrydye@yahoo.com
 */
public class CharConverter implements TypeConverter {
    
    /**
     *
     */
    public CharConverter() {
    }
    
    public Object getObject(String value) {
        if ( value != null ) {
            return new Character(value.charAt(0));
        }
        else {
            return null;
        }
    }
    
}

⌨️ 快捷键说明

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