01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ElementInfoProcessorFactory.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: import com.uwyn.rife.datastructures.EnumClass;
11:
12: import java.util.Collection;
13:
14: public class ElementInfoProcessorFactory extends EnumClass<String> {
15: public static final String MANUAL_IDENTIFIER = "manual";
16: public static final String XML_IDENTIFIER = "xml";
17: public static final String GROOVY_IDENTIFIER = "groovy";
18: public static final String JANINO_IDENTIFIER = "janino";
19: public static final String ANNOTATIONS_IDENTIFIER = "annotations";
20:
21: public static final ElementInfoProcessorFactory MANUAL = new ElementInfoProcessorFactory(
22: MANUAL_IDENTIFIER, null, null, true, true);
23: public static final ElementInfoProcessorFactory XML = new ElementInfoProcessorFactory(
24: XML_IDENTIFIER, "xml", new Xml2ElementInfo(), false, false);
25: public static final ElementInfoProcessorFactory GROOVY = new ElementInfoProcessorFactory(
26: GROOVY_IDENTIFIER, "groovy", new Groovy2ElementInfo(),
27: true, true);
28: public static final ElementInfoProcessorFactory JANINO = new ElementInfoProcessorFactory(
29: JANINO_IDENTIFIER, "janino", new Janino2ElementInfo(),
30: true, true);
31: public static final ElementInfoProcessorFactory ANNOTATIONS = new ElementInfoProcessorFactory(
32: ANNOTATIONS_IDENTIFIER, null,
33: new Annotations2ElementInfo(), true, true);
34:
35: private String mExtension = null;
36: private ElementInfoProcessor mProcessor = null;
37:
38: private boolean mExitsFromFlowlinks = false;
39: private boolean mOutputsFromDatalinks = false;
40:
41: public ElementInfoProcessorFactory(String identifier,
42: String extension, ElementInfoProcessor processor,
43: boolean exitsFromFlowlinks, boolean outputsFromDatalinks) {
44: super (identifier);
45:
46: mExtension = extension;
47: mProcessor = processor;
48: mExitsFromFlowlinks = exitsFromFlowlinks;
49: mOutputsFromDatalinks = outputsFromDatalinks;
50: }
51:
52: public String getExtension() {
53: return mExtension;
54: }
55:
56: public String getIdentifier() {
57: return mIdentifier;
58: }
59:
60: public ElementInfoProcessor getProcessor() {
61: return mProcessor;
62: }
63:
64: public boolean generateOutputsFromDatalinks() {
65: return mOutputsFromDatalinks;
66: }
67:
68: public boolean generateExitsFromFlowlinks() {
69: return mExitsFromFlowlinks;
70: }
71:
72: public static ElementInfoProcessorFactory getElementInfoProcessorFactory(
73: String identifier) {
74: return getMember(ElementInfoProcessorFactory.class, identifier);
75: }
76:
77: public static Collection<ElementInfoProcessorFactory> getElementInfoProcessorFactories() {
78: return (Collection<ElementInfoProcessorFactory>) getMembers(ElementInfoProcessorFactory.class);
79: }
80: }
|