01: package com.bostechcorp.cbesb.map;
02:
03: import java.text.SimpleDateFormat;
04: import java.util.Date;
05: import java.util.Map;
06:
07: import com.bostechcorp.cbesb.runtime.ccsl.lib.ITransformationOperation;
08:
09: public class GetCurrentDateTime implements ITransformationOperation {
10:
11: public void addProperty(String arg0, String arg1) {
12:
13: // TODO Auto-generated method stub
14:
15: }
16:
17: public void cleanup(Map<String, Object> arg0) throws Exception {
18:
19: // TODO Auto-generated method stub
20:
21: }
22:
23: public void initialize(Map<String, Object> arg0) throws Exception {
24:
25: // TODO Auto-generated method stub
26:
27: }
28:
29: public boolean process(String[] arg0, String[] arg1)
30: throws Exception {
31:
32: String pattern = arg0[0];
33: SimpleDateFormat formatter = new SimpleDateFormat(pattern);
34: String dateStr = formatter.format(new Date());
35: arg1[0] = dateStr;
36: return true;
37:
38: }
39:
40: }
|