public class ConfigurationImpl extends java.lang.Object implements Configuration
Default implementation of Configuration. This implementation reports property names in the order they are defined.
Constructor and Description |
---|
ConfigurationImpl(java.lang.Object configurable) |
Modifier and Type | Method and Description |
---|---|
void |
defineProperty(Property property)
To be called by the associated Configurable, immediately after construction (once
per property).
|
SingleValuedPropertyImpl |
defineSingleValuedProperty(java.lang.String name,
java.lang.Class<?> c,
boolean mutable) |
TemplateProperty |
defineTemplateProperty(java.lang.String name,
java.lang.Class<?> c,
java.lang.Object defaultValue) |
java.lang.Object |
getConfigurable() |
Property |
getProperty(java.lang.String name) |
java.util.List<java.lang.String> |
getPropertyNames() |
void |
removeProperty(java.lang.String name) |
void |
renameProperty(java.lang.String oldName,
java.lang.String newName) |
public ConfigurationImpl(java.lang.Object configurable)
configurable
- The Object to which this Configuration belongspublic java.lang.Object getConfigurable()
getConfigurable
in interface Configuration
Configuration.getConfigurable()
public void defineProperty(Property property)
property
- The new Propertypublic void removeProperty(java.lang.String name)
name
- Property to removepublic void renameProperty(java.lang.String oldName, java.lang.String newName)
oldName
- The existing name of the PropertynewName
- The replacement name of the Propertypublic SingleValuedPropertyImpl defineSingleValuedProperty(java.lang.String name, java.lang.Class<?> c, boolean mutable)
name
- Property to be definedc
- Class on which the property is definedmutable
- Mutable?public TemplateProperty defineTemplateProperty(java.lang.String name, java.lang.Class<?> c, java.lang.Object defaultValue)
name
- Property to be definedc
- Class on which the property is defineddefaultValue
- Default objectpublic java.util.List<java.lang.String> getPropertyNames()
getPropertyNames
in interface Configuration
Configuration.getPropertyNames()
public Property getProperty(java.lang.String name) throws StructuralException
getProperty
in interface Configuration
name
- Name of a configuration propertyStructuralException
- if the named property does not existConfiguration.getProperty(java.lang.String)