|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.config.BaseConfig
public abstract class BaseConfig
A abstract base class for all config classes. Provide basic support for arbitrary properties
Field Summary | |
---|---|
protected boolean |
configured
Indicates if configuration of this component been completed. |
Constructor Summary | |
---|---|
BaseConfig()
|
Method Summary | |
---|---|
protected java.util.Properties |
copyProperties()
Return a copy of the properties held by this object. |
void |
freeze()
Freeze the configuration of this action. |
protected java.util.Properties |
getProperties()
Return the entire set of properties configured for this object. |
java.lang.String |
getProperty(java.lang.String key)
Return the property-value for the specified key, if any; otherwise return null . |
protected void |
inheritProperties(BaseConfig baseConfig)
Compare the properties of this config with that of the given and copy those that are not present. |
protected void |
setProperties(java.util.Properties properties)
Set the entire set of properties configured for this object. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Set an arbitary key/value pair which can be retrieved by this config class. |
void |
throwIfConfigured()
Throw IllegalStateException if configuration is frozen. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean configured
Constructor Detail |
---|
public BaseConfig()
Method Detail |
---|
public void freeze()
public void throwIfConfigured()
IllegalStateException
if configuration is frozen.
java.lang.IllegalStateException
- if configuration is frozenpublic void setProperty(java.lang.String key, java.lang.String value)
Set an arbitary key/value pair which can be retrieved by this
config class. This facility should eliminate many use cases for
subclassing *Config
classes by providing a mechanism to
pass any amount of arbitrary configuration information into an config
class.
IllegalStateException
will be thrown.
Example
<action path="/example" type="com.example.MyAction">
<set-property key="foo" property="bar" />
</action>
key
- the key by which this value will be retrievedvalue
- the value to store with the supplied key
java.lang.IllegalStateException
- if this module configuration has been
frozenpublic java.lang.String getProperty(java.lang.String key)
null
.
key
- a key specified in the struts-config
file
protected java.util.Properties getProperties()
Return the entire set of properties configured for this object. At this time, this only needs to be exposed to support inheritance, so choosing a conservative access modifier ("protected").
protected void setProperties(java.util.Properties properties)
protected void inheritProperties(BaseConfig baseConfig)
Compare the properties of this config with that of the given and copy those that are not present. This method is used by subclasses that support configuration inheritance.
baseConfig
- The config object to copy properties from.protected java.util.Properties copyProperties()
Return a copy of the properties held by this object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |