KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columa > core > config > IDefaultItem


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columa.core.config;
19
20 import org.columba.core.xml.XmlElement;
21
22 /**
23  * @author fdietz
24  *
25  */

26 public interface IDefaultItem {
27
28     XmlElement getRoot();
29
30     /** ********************** composition pattern ********************* */
31
32     XmlElement getElement(String JavaDoc pathToElement);
33
34     XmlElement getChildElement(int index);
35
36     int getChildCount();
37
38     XmlElement getChildElement(String JavaDoc pathToElement, int index);
39
40     boolean contains(String JavaDoc key);
41
42     String JavaDoc get(String JavaDoc key);
43
44     String JavaDoc getString(String JavaDoc pathToElement, String JavaDoc key);
45     
46     String JavaDoc getStringWithDefault(String JavaDoc pathToElement, String JavaDoc key, String JavaDoc defaultValue);
47
48     void setString(String JavaDoc key, String JavaDoc newValue);
49
50     void setString(String JavaDoc pathToElement, String JavaDoc key, String JavaDoc newValue);
51
52     /** ************************** helper classes ************************** */
53
54     int getInteger(String JavaDoc key);
55
56     int getIntegerWithDefault(String JavaDoc key, int defaultValue);
57
58     int getInteger(String JavaDoc pathToElement, String JavaDoc key);
59
60     int getIntegerWithDefault(String JavaDoc pathToElement, String JavaDoc key, int defaultValue);
61
62     void setInteger(String JavaDoc key, int value);
63
64     void setInteger(String JavaDoc pathToElement, String JavaDoc key, int value);
65
66     boolean getBooleanWithDefault(String JavaDoc key, boolean defaultValue);
67
68     boolean getBoolean(String JavaDoc key);
69
70     boolean getBoolean(String JavaDoc pathToElement, String JavaDoc key);
71
72     boolean getBooleanWithDefault(String JavaDoc pathToElement, String JavaDoc key, boolean defaultValue);
73
74     void setBoolean(String JavaDoc key, boolean value);
75
76     void setBoolean(String JavaDoc pathToElement, String JavaDoc key, boolean value);
77
78     boolean equals(Object JavaDoc obj);
79
80     /** {@inheritDoc} */
81     int hashCode();
82
83     /** {@inheritDoc} */
84     Object JavaDoc clone();
85
86     /**
87      * @param string
88      * @param string2
89      * @return
90      */

91     String JavaDoc getStringWithDefault(String JavaDoc key, String JavaDoc defaultValue);
92 }
Popular Tags