|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
java.util.Properties
org.apache.avalon.util.defaults.Defaults
Gets a set of default property values based on a sequence of default value search components or finders.
Field Summary |
Fields inherited from class java.util.Properties |
defaults |
Constructor Summary | |
Defaults(String[] a_singles,
String[] a_enumerated,
DefaultsFinder[] a_finders)
Creates and populates a set of properties |
Method Summary | |
static void |
discover(Defaults a_defaults,
Properties[] a_sources,
boolean a_haltOnDiscovery)
Merges a set of properties from source Properties into a Defaults instance. |
static String |
discover(String l_key,
Properties[] a_sources,
boolean a_haltOnDiscovery)
Discovers a value within a set of Properties either halting on the first time the property is discovered or continuing on to take the last value found for the property key. |
boolean |
getBoolean(String a_key)
Utility method that gets a key's value and returns a boolean value to represent it. |
String[] |
getEnumerated()
Gets the base names of enumerated multi-valued keys. |
String[] |
getEnumerated(String a_base)
Gets the default values for an enumerated key. |
DefaultsFinder[] |
getFinders()
Gets the linear set of finders composing the search policy. |
String[] |
getSingles()
Gets the names of all the single valued properties. |
static Properties |
getStaticProperties(Class ref,
String path)
Read in a static properties resource relative to a supplied class and path. |
static void |
macroExpand(Properties a_expanded,
Properties[] a_optionals)
Expands out a set of property key macros in the following format ${foo.bar} where foo.bar is a property key, by dereferencing the value of the key using the original source Properties and other optional Properties. |
Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Defaults(String[] a_singles, String[] a_enumerated, DefaultsFinder[] a_finders)
a_singles
- single valued key namesa_enumerated
- multi-valued key namesa_finders
- search components used for staged discovery of defaultsMethod Detail |
public String[] getEnumerated()
public DefaultsFinder[] getFinders()
public String[] getSingles()
public String[] getEnumerated(String a_base)
a_base
- the base of the enumerated key
public boolean getBoolean(String a_key)
a_key
- the boolean property key
public static void discover(Defaults a_defaults, Properties[] a_sources, boolean a_haltOnDiscovery)
a_defaults
- the defaults to populate on discoverya_sources
- the sources to searcha_haltOnDiscovery
- true to halt on first find or false to continue
to last findpublic static String discover(String l_key, Properties[] a_sources, boolean a_haltOnDiscovery)
l_key
- a property keya_sources
- a set of source Propertiesa_haltOnDiscovery
- true if we stop on finding a value, false
otherwise
public static void macroExpand(Properties a_expanded, Properties[] a_optionals)
a_expanded
- the Properties to perform the macro expansion upona_optionals
- null or an optional set of Properties to use for
dereferencing macro keys (foo.bar)public static Properties getStaticProperties(Class ref, String path) throws IOException
ref
- a class used to establish a classloader and anchors
relative path referencespath
- the resoruce address
IllegalStateException
- if the path is unresolvable
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |