KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jcorporate > expresso > kernel > Configuration


1 /* ====================================================================
2  * The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
3  *
4  * Copyright (c) 1995-2003 Jcorporate Ltd. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * 3. The end-user documentation included with the redistribution,
19  * if any, must include the following acknowledgment:
20  * "This product includes software developed by Jcorporate Ltd.
21  * (http://www.jcorporate.com/)."
22  * Alternately, this acknowledgment may appear in the software itself,
23  * if and wherever such third-party acknowledgments normally appear.
24  *
25  * 4. "Jcorporate" and product names such as "Expresso" must
26  * not be used to endorse or promote products derived from this
27  * software without prior written permission. For written permission,
28  * please contact info@jcorporate.com.
29  *
30  * 5. Products derived from this software may not be called "Expresso",
31  * or other Jcorporate product names; nor may "Expresso" or other
32  * Jcorporate product names appear in their name, without prior
33  * written permission of Jcorporate Ltd.
34  *
35  * 6. No product derived from this software may compete in the same
36  * market space, i.e. framework, without prior written permission
37  * of Jcorporate Ltd. For written permission, please contact
38  * partners@jcorporate.com.
39  *
40  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43  * DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
44  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
46  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51  * SUCH DAMAGE.
52  * ====================================================================
53  *
54  * This software consists of voluntary contributions made by many
55  * individuals on behalf of the Jcorporate Ltd. Contributions back
56  * to the project(s) are encouraged when you make modifications.
57  * Please send them to support@jcorporate.com. For more information
58  * on Jcorporate Ltd. and its products, please see
59  * <http://www.jcorporate.com/>.
60  *
61  * Portions of this software are based upon other open source
62  * products and are subject to their respective licenses.
63  */

64 package com.jcorporate.expresso.kernel;
65
66 /**
67  * This interface is a read-only interface into a dyna-bean. It is used
68  * to contracturally enforce a component only being able to read it's own
69  * configuration. DefaultConfigBean is the typical implementation of this interface
70  *
71  * @author Michael Rimov
72  * @see com.jcorporate.expresso.kernel.internal.DefaultConfigBean
73  * @since Expresso 5.1
74  */

75 public interface Configuration {
76
77     /**
78      * Return the value of a simple property with the specified name
79      *
80      * @param name Name of the property whose value is to be retrieved
81      * @return java.lang.Object representing the property value.
82      * @throws java.lang.IllegalArgumentException
83      * If there is no property of the specified name
84      */

85     public Object JavaDoc get(java.lang.String JavaDoc name);
86
87     /**
88      * Return the value of an indexed property with the specified name.
89      *
90      * @param name Name of the property whose value is to be retrieved
91      * @param index Index of the value to be retrieved
92      * @return java.lang.Object representing the property value.
93      * @throws java.lang.IllegalArgumentException
94      * if there is no property of the
95      * specified name
96      * @throws java.lang.IndexOutOfBoundsException
97      * If the specified index is
98      * outside the range of the underlying property
99      * @throws java.lang.NullPointerException If no array or List has been
100      * initialized for this property
101      */

102     public Object JavaDoc get(java.lang.String JavaDoc name, int index);
103
104
105     /**
106      * Retrieve ALL the indexed properties defined by parameter name.
107      *
108      * @param name the name of the property
109      * @return java.util.List
110      */

111     public java.util.List JavaDoc getIndexedProperties(String JavaDoc name);
112
113     /**
114      * Return the value of a mapped property with the specified name, or null
115      * if there is no value for the specified key
116      *
117      * @param name Name of the property whose value is to be retrieved
118      * @param key Key of the value to be retrieved
119      * @return java.lang.Object representing the property value.
120      * @throws java.lang.IllegalArgumentException
121      * If there is no property
122      * of the specified name
123      */

124     public Object JavaDoc get(java.lang.String JavaDoc name, java.lang.String JavaDoc key);
125
126     /**
127      * Retrieved all the mapped properties defined by name
128      *
129      * @param name the name of the mapped properties to retrieve
130      * @return java.util.Map of all properties keyed by the property key.
131      */

132     public java.util.Map JavaDoc getMappedProperties(String JavaDoc name);
133
134
135     /**
136      * Does the specified mapped property contain a value for the specified key value?
137      *
138      * @param name Name of the property to check
139      * @param key Name of the key to check
140      * @return true if the property exists.
141      * @throws IllegalArgumentException upon error
142      */

143     public boolean contains(java.lang.String JavaDoc name, java.lang.String JavaDoc key);
144
145 }
Popular Tags