KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > datatypes > processors > CharTransformerProcessorFactory


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.datatypes.processors;
11
12 import org.mmbase.util.functions.Parameters;
13 import org.mmbase.util.transformers.*;
14
15
16 /**
17  * Wraps a {@link org.mmbase.util.transformers.ParameterizedTransformerFactory} (it <em>must</em> produces
18  * CharTransformer), to be a ParameterizedProcessorFactory. Of course based on {@link CharTransformerProcessor}.
19  *
20  * @author Michiel Meeuwissen
21  * @version $Id: CharTransformerProcessorFactory.java,v 1.2 2005/11/23 12:11:25 michiel Exp $
22  * @since MMBase-1.8
23  */

24
25 public class CharTransformerProcessorFactory implements ParameterizedProcessorFactory {
26
27     private ParameterizedTransformerFactory factory;
28
29     public CharTransformerProcessorFactory(ParameterizedTransformerFactory f) {
30         factory = f;
31     }
32
33     public Processor createProcessor(Parameters parameters) {
34         CharTransformer ct = (CharTransformer) factory.createTransformer(parameters);
35         return new CharTransformerProcessor(ct);
36     }
37
38
39     public Parameters createParameters() {
40         return factory.createParameters();
41     }
42
43 }
44
Popular Tags