01: /*
02: @license.text@
03: */
04: package com.pavelvlasov.util.samples;
05:
06: import java.io.File;
07: import java.util.HashMap;
08: import java.util.Map;
09:
10: import javax.xml.transform.stream.StreamResult;
11:
12: import biz.hammurapi.config.MapContext;
13: import biz.hammurapi.metrics.SimpleMetric;
14: import biz.hammurapi.util.ClassTransformerFactory;
15:
16: /**
17: * @author Pavel Vlasov
18: * @revision $Revision$
19: */
20: public class MetricTransformationSample {
21:
22: public static void main(String[] args) throws Exception {
23: SimpleMetric sm = new SimpleMetric("Sample metric");
24: sm.add(33, 0);
25: sm.add(44, 1);
26: ClassTransformerFactory ctf = new ClassTransformerFactory(null,
27: null, true);
28: Map map = new HashMap();
29: map.put("footer", "<HR/><i>Pavel Vlasov, 2005</i>");
30: ctf.transform(sm, "metric", null, null, new MapContext(map),
31: null, new StreamResult(new File("SampleMetric.html")));
32: }
33: }
|