01: /*
02: * SDefaultFormatter.java
03: *
04: * Created on 4. September 2006, 14:19
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.wings.text;
11:
12: /**
13: *
14: * @author erik
15: */
16: public class SDefaultFormatter extends SAbstractFormatter {
17:
18: private Class valueClass = null;
19:
20: /** Creates a new instance of SDefaultFormatter */
21: public SDefaultFormatter() {
22: }
23:
24: /**
25: * @param text String to convert
26: * @return Object representation of text
27: */
28: public Object stringToValue(String text)
29: throws java.text.ParseException {
30: return text;
31: }
32:
33: /**
34: * @param value Value to convert
35: * @return String representation of value
36: */
37: public String valueToString(Object value)
38: throws java.text.ParseException {
39: String string = "";
40: if (value != null)
41: string = value.toString();
42: return string;
43: }
44:
45: /**
46: * Sets the valueClass
47: * @param valueClass the valueClass
48: */
49: public void setValueClass(Class<?> valueClass) {
50: this .valueClass = valueClass;
51: }
52:
53: /**
54: * Returns the valueClass
55: * @return Class the valueClass
56: */
57: public Class<?> getValueClass() {
58: return valueClass;
59: }
60:
61: }
|