KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > repository > config > Config


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.repository.config;
8
9
10 import java.util.Properties JavaDoc;
11
12 import com.inversoft.beans.JavaBean;
13
14
15 /**
16  * This is the Configuration interface which is used by
17  * the Repository to construct items as well as populate
18  * the items with initial property values and references.
19  *
20  * @author Brian Pontarelli
21  */

22 public interface Config {
23
24     /**
25      * Returns the id of the item
26      *
27      * @return The id of the item
28      * @since 2.0
29      */

30     String JavaDoc getID();
31
32     /**
33      * Returns the name of the class that is the type of this item
34      *
35      * @return The name of the class
36      * @since 1.0
37      */

38     Class JavaDoc getBeanClass();
39
40     /**
41      * Returns the scope of the item as a String which will be one
42      * of the three constants REQUEST, SESSION, or APPLICATION. This
43      * means that you may use the <pre)==</pre> operator to compare
44      * these Strings.
45      *
46      * @return The scope of the item as a String
47      * @since 1.0
48      */

49     int getScope();
50
51     /**
52      * Returns the scope of the item as an int which will be one
53      * of the three constants REQUEST_INT, SESSION_INT, or
54      * APPLICATION_INT
55      *
56      * @return The scope of the item as an int
57      * @since 2.0
58      */

59     String JavaDoc getScopeStr();
60
61     /**
62      * Returns the list of Properties and initial values of this item
63      *
64      * @return The list of Properties
65      * @since 1.0
66      */

67     Properties JavaDoc getProperties();
68
69     /**
70      * Returns the list of references of this item
71      *
72      * @return The list of references
73      * @since 1.0
74      */

75     Properties JavaDoc getReferences();
76
77     /**
78      * Returns true if the item has a property with the given name
79      *
80      * @param name The name of the property to check
81      * @return True if the item has the property, false otherwise
82      * @since 2.0
83      */

84     boolean hasProperty(String JavaDoc name);
85
86     /**
87      * Returns true if the item has a reference with the given name
88      *
89      * @param name The name of the reference to check
90      * @return True if the item has the reference, false otherwise
91      * @since 1.0
92      */

93     boolean hasReference(String JavaDoc name);
94
95     /**
96      * Returns the JavaBean instance for this item. This is used when
97      * accessing properties of the item.
98      *
99      * @return The JavaBean instance for the item
100      * @since 1.0
101      */

102     JavaBean getJavaBean();
103 }
104
Popular Tags