KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > actionflow > config > Namespace


1 /*
2  * Copyright (c) 2002, Inversoft Corporation, All Rights Reserved
3  */

4 package com.inversoft.verge.mvc.controller.actionflow.config;
5
6
7 import java.util.Iterator JavaDoc;
8
9 import com.inversoft.verge.mvc.config.BaseFormConfig;
10 import com.inversoft.verge.mvc.config.FormConfigRegistry;
11 import com.inversoft.verge.mvc.controller.LongTxnSetup;
12
13
14 /**
15  * This class defines an ActionFlow namespace which is composed
16  * of Nodes and links. The links are part of the Node
17  * objects which described the Nodes in the namespace.
18  *
19  * @author Brian Pontarelli
20  * @since 2.0
21  * @version 2.0
22  */

23 public interface Namespace extends FormConfigRegistry {
24
25     /**
26      * Returns the name of this namespace.
27      *
28      * @return The name of this namespace
29      */

30     String JavaDoc getName();
31
32     /**
33      * Returns the type of this namespace (this defaults to the constant
34      * DefaultTypes.NAMESPACE).
35      *
36      * @return The type of this namespace
37      */

38     String JavaDoc getType();
39
40     /**
41      * Returns the config for the Node in the namespace with the given name.
42      *
43      * @return The Node with the given name or null if it doesn't exist
44      */

45     Node getNode(String JavaDoc name);
46
47     /**
48      * Adds the given Node to the namespace. This is stored in the namespace
49      * under its name which is retrieved using the {@link
50      * com.inversoft.verge.mvc.controller.actionflow.config.Node#getName() getName()}
51      * method. If there was already a Node with the given name, it is
52      * returned
53      *
54      * @param nodeConfig The Node to add to the namespace
55      * @return The previous Node with the same name as the new Node
56      * or null if there wasn't one.
57      * @throws IllegalArgumentException If Node is null
58      */

59     Node addNode(Node nodeConfig);
60
61     /**
62      * Returns an iterator over all the Nodes in this namespace. This Iterator
63      * should be a live Iterator so that calling the remove method will remove
64      * the Node from the Namespace.
65      *
66      * @return An Iterator over all the Nodes
67      */

68     Iterator JavaDoc nodeIterator();
69
70     /**
71      * Finds an entry point, if one exists, for the given name. This is
72      * implementation independent.
73      *
74      * @param name The name to locate an entry point for
75      * @return The entry point Node or null if one doesn't exist
76      */

77     Node findEntry(String JavaDoc name);
78
79
80     /**
81      * Adds the given form to the namespace. This is stored in the namespace
82      * under its name which is retrieved using the {@link BaseFormConfig#getName()
83      * getName()} method. If there was already a form with the given name, it is
84      * returned.
85      *
86      * @param form The BaseFormConfig to add to the namespace
87      * @return The previous BaseFormConfig with the same name as the new form
88      * or null if there wasn't one
89      * @throws IllegalArgumentException If node is null
90      */

91     BaseFormConfig addForm(BaseFormConfig form) throws IllegalArgumentException JavaDoc;
92
93     /**
94      * Returns an iterator over all the Forms in this namespace. This Iterator
95      * should be a live Iterator so that calling the remove method will remove
96      * the Form from the Namespace.
97      *
98      * @return An Iterator over all the Forms
99      */

100     Iterator JavaDoc formIterator();
101
102     /**
103      * Returns the long transaction setup class defined in the configuration
104      * file for this namespace.
105      *
106      * @return The class
107      */

108     LongTxnSetup getLongTxnSetup();
109 }
Popular Tags