KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > binding > Container


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19 package org.enhydra.zeus.binding;
20
21 import java.util.List JavaDoc;
22
23 // Zeus imports
24
import org.enhydra.zeus.Binding;
25
26 /**
27  * <p>
28  * <code>Container</code> implements the <code>{@link Binding}</code>
29  * interface and defines behavior for a binding that can contain other
30  * bindings (usually <code>{@link Property}</code> implementations). It
31  * is used to represent objects which have nested objects.
32  * </p><p>
33  * Examples of bindings that would be containers are Java custom objects
34  * with properties. However, Java objects that are pre-defined types
35  * but can contain other objects, such as a <code>List</code>, would not
36  * be containers, as their contents cannot be controlled in as fine-grained
37  * a fashion as custom objects can.
38  * </p>
39  *
40  * @author Brett McLaughlin
41  */

42 public interface Container extends Binding {
43
44     /**
45      * <p>
46      * This will add a <code>{@link Property}</code> to
47      * the member variables of this <code>Container</code>.
48      * </p><p>
49      * It is important to note that this is simply an instance
50      * variable being added to (in most cases) a custom
51      * Java class definition. That variable/property
52      * doesn't have a value (although it might have a
53      * default value) until marshalling and unmarshalling
54      * occurs.
55      * </p>
56      *
57      * @param property <code>Property</code> to add.
58      */

59     public void addProperty(Property property);
60     
61     /**
62      * <p>
63      * This will remove a <code>{@link Property}</code>
64      * from this <code>Container</code>, given the
65      * property's name. If a successful removal occurs,
66      * the boolean value <code>true</code> is retruned.
67      * If no <code>Property<code> is found with the supplied
68      * Java name, the boolean value <code>false</code> is returned.
69      * </p>
70      *
71      * @param javaName <code>String</code> Java name of
72      * <code>Property</code> to remove.
73      * @return <code>boolean</code> - indicates whether
74      * the specified named <code>Property</code>
75      * was found and removed.
76      */

77     public boolean removeProperty(String JavaDoc javaName);
78     
79     /**
80      * <p>
81      * This does a wholesale replacement of this binding's current
82      * properties, removing all current ones and replacing with the
83      * supplied <code>List</code> of new properties.
84      * </p>
85      *
86      * @param properties <code>List</code> of properties to use for this
87      * container.
88      */

89     public void setProperties(List JavaDoc properties);
90     
91     /**
92      * <p>
93      * This will return a list of all the
94      * <code>{@link Property}</code> objects that
95      * this <code>Container</code> has. If there are
96      * none, this will return an empty <code>List</code>.
97      * </p>
98      *
99      * @return <code>List</code> - properties for this
100      * <code>Container</code>.
101      */

102     public List JavaDoc getProperties();
103     
104     /**
105      * <p>
106      * This will clear all the properties for this <code>Container</code>.
107      * </p>
108      */

109     public void clearProperties();
110
111 }
112
Popular Tags