public class PropertyRegistry extends FixedPropertyFinder
PropertyTag objects in a single name-space
A PropertyRegistry allows enumeration over the set of
available properties. It also implements PropertyFinder so String names can be parsed
to PropertyTags.
Where the set of properties are fixed at compile time the PropertyRegistry and the
PropertyTags it contains can be declared as static constants.
If a PropertyRegistry has to be created at run-time then it should be populated
fully as soon as possible so the set of available Properties remains consistent over time.
Unfortunately It is possible to create multiple PropertyRegistry instances with the same name. For example where there are multiple accounting tables each of which have generated a set of dynamic properties using the same policy but the contents being dependent on the configuration of the accounting table. This should be avoided because PropertyRegistry objects with the same name count as being equal so problems will arise if these tables are then combined into a composite UsageProducer.
name, PROPERTY_FINDER_NAME_REGEXP, PROPERTY_FINDER_PREFIX_REGEXP, PROPERTY_FINDER_SEPERATOR, registry| Constructor and Description |
|---|
PropertyRegistry(java.lang.String name,
java.lang.String description) |
| Modifier and Type | Method and Description |
|---|---|
PropertyFinder |
copy()
return a new PropertyFinder that represents a copy of the current state of this object.
|
void |
lock()
prevent further modifications to this regismenttry
For a statically allocated PropertyREgistry this can be
invoked in as assign
|
equals, find, find, find, getDescription, getPrefix, getProperties, getProperties, hashCode, hasProperty, make, size, toStringpublic PropertyRegistry(java.lang.String name,
java.lang.String description)
public PropertyFinder copy()
PropertyFindercopy in interface PropertyFindercopy in class FixedPropertyFinderpublic void lock()