01: /*
02: * Created on Apr 13, 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.util;
08:
09: import java.text.SimpleDateFormat;
10: import java.util.HashMap;
11:
12: import org.xdev.base.xssl.XSSLObject;
13:
14: /**
15: * @author AYegorov
16: *
17: * To change the template for this generated type comment go to
18: * Window>Preferences>Java>Code Generation>Code and Comments
19: */
20: public class DateFormatter extends XSSLObject {
21:
22: private SimpleDateFormat sdf = new SimpleDateFormat();
23:
24: /**
25: * @param id
26: */
27: public DateFormatter(String id) {
28: super (id);
29: // XXX Auto-generated constructor stub
30: }
31:
32: /**
33: * @param id
34: * @param properties
35: */
36: public DateFormatter(String id, HashMap properties) {
37: super (id, properties);
38: // XXX Auto-generated constructor stub
39: }
40:
41: /* (non-Javadoc)
42: * @see org.xdev.base.xssl.XSSLObject#processObject(java.lang.Object)
43: */
44: protected Object processObject(Object obj) throws Exception {
45: sdf.applyPattern(this .getProperty("pattern"));
46:
47: return sdf.format(obj);
48: }
49:
50: }
|