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