KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > node > Folder


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.config.node;
19
20 import org.sape.carbon.core.config.Configuration;
21 import org.sape.carbon.core.config.node.link.LinkNode;
22 import org.sape.carbon.core.config.node.link.LinkNodeConfiguration;
23
24 /**
25  * A <code>Folder</code> is a <code>Node</code> that contains
26  * other <code>Node</code>s. The central mehtods of this interface provide
27  * functionality to add and fetch <code>Node</code>s contained within a
28  * <code>Folder</code>.
29  *
30  * Copyright 2002 Sapient
31  * @since carbon 1.0
32  * @author Douglas Voet, March 2002
33  * @version $Revision: 1.13 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
34  */

35 public interface Folder extends Node {
36     /**
37      * Creates a new child <code>ConfigurationDocument</code> and returns a
38      * reference to the newly created <code>ConfigurationDocument</code>.
39      *
40      * @param name Name of the ConfigurationDocument to be created.
41      * @param config the document to add to the Folder
42      * @return The newly created ConfigurationDocument.
43      *
44      * @throws NodeCreationException when the node can not
45      * be created, possibly because the node element already exists in
46      * this node, or creation of the node is otherwise forbidden. An exception
47      * should also be thrown when this node's getAllowsChildren method returns
48      * <code>false</code>.
49      */

50     ConfigurationDocument addConfigurationDocument(
51             String JavaDoc name, Configuration config)
52         throws NodeCreationException;
53
54     /**
55      * Creates a new child <code>Folder</code> and returns a reference to
56      * the newly created <code>Folder</code>.
57      *
58      * @param name Name of the Folder to be created.
59      * @return The newly created Folder.
60      *
61      * @throws NodeCreationException when the node can not
62      * be created, possibly because the node element already exists in
63      * this node, or creation of the node is otherwise forbidden. An exception
64      * should also be thrown when this node's getAllowsChildren method returns
65      * <code>false</code>.
66      */

67     Folder addSubFolder(String JavaDoc name) throws NodeCreationException;
68
69     /**
70      * Adds a link to the folder.
71      *
72      * @param name name of the link to add
73      * @param linkConfiguration the link configuration to create
74      * @return newly created LinkNode
75      * @throws NodeCreationException indicates an error adding the link
76      */

77     LinkNode addLink(String JavaDoc name, LinkNodeConfiguration linkConfiguration)
78         throws NodeCreationException;
79
80     /**
81      * Gets the factory this node used in the <code>addSubFolder</code>
82      * method to create children. This can be used by sub
83      * <code>Folder</code>s to create their own children.
84      *
85      * @return NodeFactory factory object used to create <code>Folder</code>s
86      */

87     NodeFactory getSubFolderFactory();
88
89     /**
90      * Gets the factory this node used in the
91      * <code>addConfigurationDocument</code>
92      * method to create children. This can be used by sub
93      * <code>Folder</code>s to create their own children.
94      *
95      * @return NodeFactory factory object used to create
96      * <code>ConfigurationDocument</code>s
97      */

98     NodeFactory getConfigurationDocumentFactory();
99
100     /**
101      * Gets the factory this node used in the
102      * <code>addLinkNode</code>
103      * method to create children. This can be used by sub
104      * <code>Folder</code>s to create their own children.
105      *
106      * @return NodeFactory factory object used to create
107      * <code>ConfigurationDocument</code>s
108      */

109     NodeFactory getLinkNodeFactory();
110
111 }
112
Popular Tags