KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > node > link > FolderLinkImpl


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.link;
19
20 import org.sape.carbon.core.config.Configuration;
21 import org.sape.carbon.core.config.node.ConfigurationDocument;
22 import org.sape.carbon.core.config.node.Folder;
23 import org.sape.carbon.core.config.node.NodeCreationException;
24 import org.sape.carbon.core.config.node.NodeFactory;
25 import org.sape.carbon.core.config.node.event.NodeEventListener;
26
27 /**
28  * Implementation of <code>FolderLink</code>. This is
29  * probably the only implementation that will ever be needed. It does not
30  * contain any logic specific to a data store so a new implementation should
31  * not be required when new data stores are introduced. The only thing that
32  * should be variable is which factory is used to create a link.
33  *
34  * Copyright 2002 Sapient
35  * @since carbon 1.0
36  * @author Douglas Voet, March 2002
37  * @version $Revision: 1.5 $($Author: dvoet $ / $Date: 2003/05/05 21:21:19 $)
38  */

39 public class FolderLinkImpl
40     extends AbstractLinkNode
41     implements FolderLink {
42
43     /**
44      * Constructor for FolderLinkImpl.
45      *
46      * @param linkConfigurationDocument used to implement the
47      * <code>LinkNode</code> interface
48      * @param targetFolder used to implement the
49      * <code>Folder</code> interface
50      */

51     public FolderLinkImpl(
52         ConfigurationDocument linkConfigurationDocument,
53         Folder targetFolder) {
54
55         super(linkConfigurationDocument, targetFolder);
56     }
57
58     /**
59      * @see Folder#addConfigurationDocument
60      */

61     public ConfigurationDocument addConfigurationDocument(
62         String JavaDoc name,
63         Configuration config)
64         throws NodeCreationException {
65
66         return ((Folder) super.targetNode).addConfigurationDocument(
67             name,
68             config);
69     }
70
71     /**
72      * @see Folder#addSubFolder(String)
73      */

74     public Folder addSubFolder(String JavaDoc name)
75         throws NodeCreationException {
76
77         return ((Folder) super.targetNode).addSubFolder(name);
78     }
79
80     /**
81      * @see Folder#addLink
82      */

83     public LinkNode addLink(String JavaDoc name,
84                             LinkNodeConfiguration linkConfiguration)
85                             throws NodeCreationException {
86
87         return ((Folder) super.targetNode).
88             addLink(name, linkConfiguration);
89     }
90
91     /**
92      * @see Folder#getConfigurationDocumentFactory()
93      */

94     public NodeFactory getConfigurationDocumentFactory() {
95         return ((Folder) super.targetNode)
96             .getConfigurationDocumentFactory();
97     }
98
99     /**
100      * @see Folder#getSubFolderFactory()
101      */

102     public NodeFactory getSubFolderFactory() {
103         return ((Folder) super.targetNode).getSubFolderFactory();
104     }
105
106     /**
107      * @see Folder#getLinkNodeFactory()
108      */

109     public NodeFactory getLinkNodeFactory() {
110         return ((Folder) super.targetNode).getLinkNodeFactory();
111     }
112
113
114     /**
115      * @see org.sape.carbon.core.config.node.Node#addNodeListener(NodeEventListener)
116      */

117     public void addNodeListener(NodeEventListener listener) {
118         super.targetNode.addNodeListener(listener);
119     }
120
121 }
Popular Tags