1 | public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer)↵ | | 1 | public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer)↵
|
2 | {↵ | | 2 | {↵
|
3 | // handle null, which is shown as the special string "<null>"↵ | | 3 | // handle null, which is shown as the special string "<null>"↵
|
4 | if (value.equals("<null>") || value.equals("")) ↵ | | 4 | if (value.equals("<null>") || value.equals(""))↵
|
5 | return null;↵ | | 5 | return null;↵
|
|
6 | // Do the conversion into the object in a safe manner↵ | | 6 | // Do the conversion into the object in a safe manner↵
|
7 | try↵ | | 7 | try↵
|
8 | {↵ | | 8 | {↵
|
9 | Object obj = Boolean.valueOf(value);↵ | | 9 | Object obj = new Byte(value);↵
|
10 | return obj;↵ | | 10 | return obj;↵
|
11 | }↵ | | 11 | }↵
|
12 | catch (Exception e)↵ | | 12 | catch (Exception e)↵
|
13 | {↵ | | 13 | {↵
|
14 | messageBuffer.append(e.toString() + "\n");↵ | | 14 | messageBuffer.append(e.toString()+"\n");↵
|
15 | // ?? do we need the message also, or is it automatically part of the toString()?↵ | | 15 | //?? do we need the message also, or is it automatically part of the toString()?↵
|
16 | // messageBuffer.append(e.getMessage());↵ | | 16 | //messageBuffer.append(e.getMessage());↵
|
17 | return null;↵ | | 17 | return null;↵
|
18 | | | 18 |
|