01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.kernel;
19:
20: import java.util.*;
21:
22: /**
23: * Interface that can be extended/implemented by all interfaces/classes that want
24: * to equip their respective instances with an additional parameter facility.
25: * Parameters are simple key-value pairs, both key and value are strings.
26: * Implementations can use a java.util.Properties delegate.
27: * @see java.util.Properties
28: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
29: * @version 3.4 <7 March 05>
30: * @since 2.0
31: */
32:
33: public interface PropertiesSupport {
34:
35: /**
36: * Set a property.
37: * @param key the key
38: * @param value the value
39: * @return the previous value of the specified key in this property list, or null if it did not have one.
40: */
41: Object setProperty(String key, String value);
42:
43: /**
44: * Get a property.
45: * @param key the property key
46: * @return the respective value. The method returns null if the property is not found.
47: */
48: String getProperty(String key);
49:
50: /**
51: * Remove a property.
52: * @param key the property key
53: * @return the value to which the key had been mapped, or null if the key did not have a mapping.
54: */
55: Object removeProperty(String key);
56:
57: /**
58: * Returns an enumeration of all the keys in this property list, including distinct
59: * keys in the default property list if a key of the same name has not already been
60: * found from the main properties list.
61: * @return an enumeration of all the keys in this property list, including the keys in
62: * the default property list
63: */
64: Enumeration propertyNames();
65:
66: /**
67: * Get the properties as one "properties" instance.
68: * @return a properties instance
69: */
70: Properties getProperties();
71: }
|