|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.support.AbstractConfigurationProperties de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesManagement de.smartics.properties.spi.config.support.AbstractInMemoryConfigurationProperties
@ThreadSafe public abstract class AbstractInMemoryConfigurationProperties
An implementation that stores all properties in-memory.
Constructor Summary | |
---|---|
AbstractInMemoryConfigurationProperties(ConfigurationKey key, PropertyDescriptorRegistry registry) Convenience constructor requiring that a properties file with the same name as the properties set class exists on the class path. |
|
AbstractInMemoryConfigurationProperties(ConfigurationKey key, PropertyDescriptorRegistry registry, boolean requiresDefaultOnClassPath) Default constructor requiring that a properties file with the same name as the properties set class exists on the class path. |
Method Summary | |
---|---|
AbstractInMemoryConfigurationProperties |
addClassPathProperties(Class<?> propertiesInterface) Loads the properties for the given properties interface from the class path. |
protected Property |
deletePropertyInStore(String name) Deletes the property with the given name. |
protected PropertyCollection |
getPropertyCollectionFromStore() Returns a collection to iterate over all properties of the configuration. |
protected Property |
getPropertyFromStore(String name) Fetches the property from the store by the given name. |
Property |
setPropertyToStore(String key, String value) Sets the property to the given value. |
String |
toString() Returns the string representation of the object. |
Methods inherited from class de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesManagement |
---|
addDefinitions, addDescriptors, flush, getDescriptor, getDescriptor, getMandatoryPropertyDescriptors, getProperty, getProperty, getResolvedProperty, setProperty, unsetProperty, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.smartics.properties.api.config.domain.ConfigurationPropertiesManagement |
---|
addDefinitions, addDescriptors, flush, getDescriptor, getDescriptor, getMandatoryPropertyDescriptors, getRegistry, setProperty, toSerializable, unsetProperty |
Methods inherited from interface de.smartics.properties.api.config.domain.ConfigurationProperties |
---|
addPropertyChangeListener, addPropertyChangeListener, getContext, getContext, getKey, getProperties, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValue, getPropertyValueAsString, getPropertyValueAsString, getPropertyValueAsString, getPropertyValueAsString, getResolvedProperty, getResolvedProperty, getResolvedProperty, removePropertyChangeListener, removePropertyChangeListener, validate, validate |
Methods inherited from interface de.smartics.properties.spi.config.support.ConfigurationPropertiesSpi |
---|
getProperties |
Constructor Detail |
---|
public AbstractInMemoryConfigurationProperties(ConfigurationKey key, PropertyDescriptorRegistry registry) throws de.smartics.util.lang.NullArgumentException
key
- the key that identifies the configuration.
registry
- the registry to resolve property descriptors.
de.smartics.util.lang.NullArgumentException
- if
key
or
registry
is
null
.
public AbstractInMemoryConfigurationProperties(ConfigurationKey key, PropertyDescriptorRegistry registry, boolean requiresDefaultOnClassPath) throws de.smartics.util.lang.NullArgumentException
key
- the key that identifies the configuration.
registry
- the registry to resolve property descriptors.
requiresDefaultOnClassPath
- the flag controls the behavior on not finding default properties on the classpath.
de.smartics.util.lang.NullArgumentException
- if
key
or
registry
is
null
.
Method Detail |
---|
protected final Property getPropertyFromStore(String name)
AbstractConfigurationPropertiesManagement
getPropertyFromStore
in class
AbstractConfigurationPropertiesManagement
name
- the name of the property to fetch.
null
(although the value of the property may be
null
).
public final Property setPropertyToStore(String key, String value) throws PropertyValidationException, ReadOnlyPropertyException
AbstractConfigurationPropertiesManagement
setPropertyToStore
in class
AbstractConfigurationPropertiesManagement
key
- the name of the property to set.
value
- the value to the property.
null
(although the value of the property may be
null
).
PropertyValidationException
ReadOnlyPropertyException
protected final Property deletePropertyInStore(String name)
AbstractConfigurationPropertiesManagement
deletePropertyInStore
in class
AbstractConfigurationPropertiesManagement
name
- the name of the property to delete.
protected final PropertyCollection getPropertyCollectionFromStore()
AbstractConfigurationPropertiesManagement
getPropertyCollectionFromStore
in class
AbstractConfigurationPropertiesManagement
public final AbstractInMemoryConfigurationProperties addClassPathProperties(Class<?> propertiesInterface) throws de.smartics.util.lang.NullArgumentException, ConfigurationLoadingException
The properties file is expected to be at the same location with a name identical to the interface plus the file extension .properties
.
propertiesInterface
- the properties defining interface whose properties are loaded.
de.smartics.util.lang.NullArgumentException
- if
propertiesInterface
is
null
.
ConfigurationLoadingException
- if the properties file cannot be loaded.
public String toString()
toString
in class
AbstractConfigurationProperties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |