|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.rd.conf.AbstractConfiguration
Provides base configuration functionality, including serialization,
the equals and hashCode contracts, and default
property loading.
See the loadDefaults() method for a description of how this
class goes about loading default property values.
| Field Summary |
| Fields inherited from interface java.beans.BeanInfo |
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32 |
| Constructor Summary | |
AbstractConfiguration()
|
|
| Method Summary | |
protected void |
checkFrozen()
Checks if the configuration has been frozen and if so throws a IllegalStateException, otherwise returns silently. |
boolean |
equals(java.lang.Object other)
Performs an equality check based on the properties returned from toProperties(). |
void |
free()
Free the resources used by this object. |
void |
fromProperties(java.util.Properties props)
Set this Configuration via the given Properties. |
java.beans.BeanInfo[] |
getAdditionalBeanInfo()
|
java.beans.BeanDescriptor |
getBeanDescriptor()
|
int |
getDefaultEventIndex()
|
int |
getDefaultPropertyIndex()
|
java.beans.EventSetDescriptor[] |
getEventSetDescriptors()
|
java.awt.Image |
getIcon(int kind)
|
java.beans.MethodDescriptor[] |
getMethodDescriptors()
|
protected abstract java.lang.String |
getProductName()
Return the product name. |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors()
|
protected abstract java.util.Collection |
getValues()
Return the configurable Values for this configuration. |
int |
hashCode()
Computes hash code based on the properties returned from toProperties(). |
boolean |
isFrozen()
Return true if the configuration has been frozen. |
boolean |
loadDefaults()
Invoke this method to load default values from properties. |
void |
readExternal(java.io.ObjectInput in)
Implementation of the Externalizable interface to read from
the properties written by writeExternal(java.io.ObjectOutput). |
void |
setFrozen(boolean frozen)
Following a call to this method, calls to checkFrozen() will
throw an exception. |
void |
setProperties(java.lang.String resourceName)
This method loads the named resource as a properties file. |
java.util.Properties |
toProperties()
Properties objects are cached once created so that calls to this method are relatively cheap (the properties object is still cloned for each call). |
void |
writeExternal(java.io.ObjectOutput out)
Implementation of the Externalizable interface to write
the properties returned by toProperties(). |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.solarmetric.rd.conf.Configuration |
getLog, getLogFactory, setLog, setLogFactory |
| Constructor Detail |
public AbstractConfiguration()
| Method Detail |
protected abstract java.lang.String getProductName()
loadDefaults()protected abstract java.util.Collection getValues()
Values for this configuration.
public boolean loadDefaults()
com.solarmetric.<product-name>.properties system
property for the location of a properties file to parse, where
product-name is the return value of the
getProductName() method. If no system property is defined,
the default resource location of
<product-name>.properties is used. If it exists,
the resource is parsed as a properties file. All system properties
are then added; they override any same-named properties in the
resource. The combined properties are then loaded into this
configuration.
ClassLoader.getResource(java.lang.String)public void setFrozen(boolean frozen)
checkFrozen() will
throw an exception. This method is meant to lock down the
configuration; subclasses should therefore call checkFrozen()
as the first line in all mutator methods.
setFrozen in interface Configurationpublic boolean isFrozen()
isFrozen in interface Configurationpublic java.util.Properties toProperties()
checkFrozen(), because it precedes all state changes.
toProperties in interface ConfigurationConfiguration.toProperties()public void fromProperties(java.util.Properties props)
Configuration
fromProperties in interface Configuration
public void setProperties(java.lang.String resourceName)
throws java.io.IOException
properties value with the name of a resource.
java.io.IOExceptionprotected void checkFrozen()
IllegalStateException, otherwise returns silently.
Implementations should call this method before setting any state.
public boolean equals(java.lang.Object other)
toProperties().
equals in class java.lang.Objectpublic int hashCode()
toProperties().
hashCode in class java.lang.Object
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
Externalizable interface to read from
the properties written by writeExternal(java.io.ObjectOutput).
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
Externalizable interface to write
the properties returned by toProperties().
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic java.beans.BeanInfo[] getAdditionalBeanInfo()
getAdditionalBeanInfo in interface java.beans.BeanInfopublic java.beans.BeanDescriptor getBeanDescriptor()
getBeanDescriptor in interface java.beans.BeanInfopublic int getDefaultEventIndex()
getDefaultEventIndex in interface java.beans.BeanInfopublic int getDefaultPropertyIndex()
getDefaultPropertyIndex in interface java.beans.BeanInfopublic java.beans.EventSetDescriptor[] getEventSetDescriptors()
getEventSetDescriptors in interface java.beans.BeanInfopublic java.awt.Image getIcon(int kind)
getIcon in interface java.beans.BeanInfopublic java.beans.MethodDescriptor[] getMethodDescriptors()
getMethodDescriptors in interface java.beans.BeanInfopublic java.beans.PropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors in interface java.beans.BeanInfopublic void free()
Configuration
free in interface Configuration
|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||