01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.framework;
11:
12: import java.net.URI;
13: import org.mmbase.util.functions.*;
14:
15: /**
16: * Abstract view implementation which implements getType and the specific parameters.
17: *
18: * @author Michiel Meeuwissen
19: * @version $Id: AbstractProcessor.java,v 1.7 2008/02/20 17:44:07 michiel Exp $
20: * @since MMBase-1.9
21: */
22: abstract public class AbstractProcessor implements Processor {
23:
24: /**
25: * Creates a processor which does absolutely nothing.
26: */
27: public static Processor getEmpty(final Block b) {
28: return new Processor() {
29: public Block getBlock() {
30: return b;
31: }
32:
33: public Parameter[] getParameters() {
34: return Parameter.emptyArray();
35: }
36:
37: public void process(Parameters blockParameters,
38: Parameters frameworkParameters) {
39: }
40:
41: public String toString() {
42: return "EMPTY Processor";
43: }
44:
45: public URI getUri() {
46: try {
47: return new URI("mmbase:/processor/empty");
48: } catch (Exception e) {
49: return null;
50: }
51: }
52: };
53: }
54:
55: protected final Block parent;
56:
57: public AbstractProcessor(Block p) {
58: parent = p;
59: }
60:
61: public Block getBlock() {
62: return parent;
63: }
64:
65: public URI getUri() {
66: return null;
67: }
68:
69: }
|