|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jurvis.util.JvPropertyLocator
public class JvPropertyLocator
A class used to locate a property within a set of property sources.
Property sources are registered with JvPropertyLocator using the
addSource method. Properties and
ResourceBundles may be used as property sources.
| Constructor Summary | |
|---|---|
JvPropertyLocator()
Construct a JvPropertyLocator. |
|
| Method Summary | |
|---|---|
protected boolean |
addSource(Object source)
Register a property source with this JvPropertyLocator. |
void |
addSource(Properties source)
Register a property source with this JvPropertyLocator. |
void |
addSource(ResourceBundle source)
Register a property source with this JvPropertyLocator. |
void |
addSource(String bundleName)
Register a property source with this JvPropertyLocator. |
PropertyEditor |
getEditor(Class valueType,
String valueName)
Return the PropertyEditor for a property named
valueName with type valueType. |
PropertyEditor |
getEditor(PropertyDescriptor pd)
Return the PropertyEditor for the described property. |
Object |
getObject(Component parent,
Component component,
String key,
Class valueType)
Retrieve the property object with the given key within the context of a particular named Component and its parent. |
String |
getString(Component parent,
Component component,
String key)
Retrieve the property with the given key within the context of a particular named Component and its parent. |
String |
getString(Component component,
String key)
Retrieve the property with the given key within the context of a particular named Component. |
String |
getString(String key)
Retrieve the property with the given key. |
protected boolean |
hasBaseKey(String key)
Determine if within the sources there is even a key that shares the base key of the specified key. |
protected void |
recordBaseKeys(Enumeration e)
Iterate through the keys in the given enumeration and record all the base keys. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JvPropertyLocator()
JvPropertyLocator.
| Method Detail |
|---|
public void addSource(ResourceBundle source)
JvPropertyLocator.
source - the new property sourcepublic void addSource(Properties source)
JvPropertyLocator.
source - the new property sourcepublic void addSource(String bundleName)
JvPropertyLocator.
bundleName - the name of the ResourceBundle to registerprotected boolean addSource(Object source)
JvPropertyLocator.
If you call this method directly, be sure to also perform a
recordBaseKeys on your source otherwise any unusual
properties will not be found in your source.
source - the new property source
protected void recordBaseKeys(Enumeration e)
getString and getObject.
e - an Enumeration through a sources' keysprotected final boolean hasBaseKey(String key)
key - the key whose base key is being looked for
key is found in the sourcespublic String getString(String key)
key - the key of the property to return
public String getString(Component component,
String key)
Component. In other words, look for a
property keyed as "name.key" where name is the
Component's name obtained via getName.
component - the component providing contextkey - the key of the property to return
public String getString(Component parent,
Component component,
String key)
Component and its parent. In other words,
look for a property keyed as "parent.name.key" where
parent is the name of the parent obtained via
getName and name is the Component's
name.
If no matching property is found, the property is searched for without using the parent context. In other words, look for a property keyed as "name.key."
parent - the parent of the component providing additional contextcomponent - the component providing contextkey - the key of the property to return
public Object getObject(Component parent,
Component component,
String key,
Class valueType)
Component and its parent. This method
uses getString(Component, Component, String) to locate the
property and then uses the PropertyEditor for the
valueType to convert the property string into an object.
parent - the parent of the component providing additional contextcomponent - the component providing contextkey - the key of the property to returnvalueType - the class of the property object
getString(Component, Component, String),
PropertyEditor
public PropertyEditor getEditor(Class valueType,
String valueName)
PropertyEditor for a property named
valueName with type valueType.
valueType - the Class of the desired valuevalueName - the name of the desired value
PropertyEditorpublic PropertyEditor getEditor(PropertyDescriptor pd)
PropertyEditor for the described property.
pd - the property descriptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||