01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.util;
18:
19: import java.util.List;
20:
21: /**
22: * This object holds the property settings for Cocoon. This interface is loosely based on the Settings interface
23: * introduced in 2.2 but is note equivalent to it as it is only meant to hold configuration properties.
24: *
25: * @version $Id: Settings.java 433543 2006-08-22 06:22:54Z crossley $
26: */
27: public interface Settings {
28: /** The role to lookup this bean. */
29: String ROLE = Settings.class.getName();
30:
31: /** Name of the property specifying a custom user properties file. */
32: String PROPERTY_USER_SETTINGS = "org.apache.cocoon.settings";
33:
34: /**
35: * Get the value of a property.
36: * @param key The name of the property.
37: * @return The value of the property or null.
38: */
39: String getProperty(String key);
40:
41: /**
42: * Get the value of a property.
43: * @param key The name of the property.
44: * @param defaultValue The value returned if the property is not available.
45: * @return The value of the property or if the property cannot
46: * be found the default value.
47: */
48: String getProperty(String key, String defaultValue);
49:
50: /**
51: * Return all available properties starting with the prefix.
52: * @param keyPrefix The prefix each property name must have.
53: * @return A list of property names (including the prefix) or
54: * an empty list.
55: */
56: List getProperties(String keyPrefix);
57:
58: /**
59: * Return all available properties
60: * @return A list of all property names or an empty list.
61: */
62: List getProperties();
63:
64: /**
65: * Return the number of properties that have been defined
66: * @return The number of properties that have been defined.
67: */
68: int size();
69: }
|