KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > setup > util > CharEditor


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.setup.util;
10
11 import java.beans.PropertyEditor JavaDoc;
12
13 /**
14  * @author <a HREF="mailto:palber@novell.com">Polina Alber</a>
15  * Date: Apr 15, 2005; Time: 11:50:47 AM
16  * @since JBoss portal 2.0
17  * Class org.jboss.portal.setup.util.CharEditor PropertyEditor implementation for an object of type Character
18  */

19 public class CharEditor extends PropertyEditorBase implements PropertyEditor JavaDoc
20 {
21    /**
22     * Empty contructor for instansiation by a PropertyEditorManager
23     */

24    public CharEditor()
25    {
26       super();
27       setClassType(Character JavaDoc.class);
28    }
29
30    /**
31     * @param value - object value to be converted to a String.
32     * @return String representation of a specified value.
33     */

34    protected String JavaDoc converToString(Object JavaDoc value)
35    {
36       String JavaDoc lStrValue = null;
37       if (value != null)
38       {
39          {
40             lStrValue = value.toString();
41          }
42       }
43       return lStrValue;
44    }
45
46    /**
47     * @param strValue - string representation of a value to be converted to a String
48     * @return an Object representation of a String value.
49     */

50    protected Object JavaDoc convertToValue(String JavaDoc strValue)
51    {
52       return new Character JavaDoc(strValue.charAt(0));
53    }
54 }
55
56
Popular Tags