|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NakedObjectConfiguration
(Mostly!) immutable set of properties representing the configuration of the running system.
The NakedObjectConfiguration is one part of a mutable/immutable pair pattern
(cf String and StringBuilder). What this means is, as components are
loaded they can discover their own configuration resources. These are added
to ConfigurationBuilder.
Thus the NakedObjectConfiguration held by different components may vary,
but with each being a possible superset of the previous.
TODO: we should make this strictly immutable by removing the add(String, String) method.
| Method Summary | |
|---|---|
void |
add(java.lang.String name,
java.lang.String value)
Adds a name-value pair to the list of properties. |
NakedObjectConfiguration |
createSubset(java.lang.String prefix)
Creates a new NakedObjectConfiguration containing the properties starting with the specified prefix. |
boolean |
getBoolean(java.lang.String name)
Gets the boolean value for the specified name where no value or 'on' will result in true being returned; anything gives false. |
boolean |
getBoolean(java.lang.String name,
boolean defaultValue)
Gets the boolean value for the specified name. |
java.awt.Color |
getColor(java.lang.String name)
Gets the color for the specified name. |
java.awt.Color |
getColor(java.lang.String name,
java.awt.Color defaultValue)
Gets the color for the specified name. |
java.awt.Font |
getFont(java.lang.String name)
Gets the font for the specified name. |
java.awt.Font |
getFont(java.lang.String name,
java.awt.Font defaultValue)
Gets the font for the specified name. |
int |
getInteger(java.lang.String name)
Gets the number value for the specified name. |
int |
getInteger(java.lang.String name,
int defaultValue)
Gets the number value for the specified name. |
java.lang.String[] |
getList(java.lang.String name)
Returns a list of entries for the single configuration property with the specified name. |
NakedObjectConfiguration |
getProperties(java.lang.String withPrefix)
Creates a new NakedObjectConfiguration containing the properties starting with the specified prefix. |
ResourceStreamSource |
getResourceStreamSource()
The ResourceStreamSource that was used to build this configuration. |
java.lang.String |
getString(java.lang.String name)
Returns the configuration property with the specified name. |
java.lang.String |
getString(java.lang.String name,
java.lang.String defaultValue)
|
boolean |
hasProperty(java.lang.String name)
|
boolean |
isEmpty()
|
java.util.Enumeration<java.lang.String> |
propertyNames()
|
int |
size()
|
| Methods inherited from interface org.nakedobjects.metamodel.commons.debug.DebugInfo |
|---|
debugData, debugTitle |
| Methods inherited from interface org.nakedobjects.metamodel.commons.component.Injectable |
|---|
injectInto |
| Method Detail |
|---|
void add(java.lang.String name,
java.lang.String value)
NakedObjectConfiguration createSubset(java.lang.String prefix)
getProperties(String) method, except the property names have their prefixes removed.
getProperties(String)boolean getBoolean(java.lang.String name)
name - the property name
boolean getBoolean(java.lang.String name,
boolean defaultValue)
name - the property namedefaultValue - the value to use as a defaultjava.awt.Color getColor(java.lang.String name)
name - the property name
java.awt.Color getColor(java.lang.String name,
java.awt.Color defaultValue)
name - the property namedefaultValue - the value to use as a defaultjava.awt.Font getFont(java.lang.String name)
name - the property name
java.awt.Font getFont(java.lang.String name,
java.awt.Font defaultValue)
name - the property namedefaultValue - the color to use as a defaultjava.lang.String[] getList(java.lang.String name)
If there is no matching property then returns an empty array.
int getInteger(java.lang.String name)
name - the property name
int getInteger(java.lang.String name,
int defaultValue)
name - the property namedefaultValue - the value to use as a defaultNakedObjectConfiguration getProperties(java.lang.String withPrefix)
createSubset(String) method except the names of the properties are not
altered when copied.
createSubset(String)java.lang.String getString(java.lang.String name)
java.lang.String getString(java.lang.String name,
java.lang.String defaultValue)
boolean hasProperty(java.lang.String name)
boolean isEmpty()
java.util.Enumeration<java.lang.String> propertyNames()
int size()
ResourceStreamSource getResourceStreamSource()
ResourceStreamSource that was used to build this configuration.
This replaces the old rootPath() method.
ConfigurationBuilder.getResourceStreamSource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||