com.pow2.resources
Class PropertyContainerImpl

java.lang.Object
  extended bycom.pow2.resources.PropertyContainerImpl
All Implemented Interfaces:
PropertyContainer, Serializable
Direct Known Subclasses:
Prefs, StringBufferNodeVisitor

public abstract class PropertyContainerImpl
extends Object
implements PropertyContainer, Serializable

Property container class.

Author:
Paul Monday
See Also:
Serialized Form

Field Summary
protected  org.apache.log4j.Category cat
          Log4J category.
protected  Properties properties
          properties table
 
Constructor Summary
PropertyContainerImpl()
          Constructor for the PropertyContainerImpl object
 
Method Summary
 void addProperty(Object value, String token)
          Add a property associated with a token name.
 Object getObject(String token)
          Retrieve a value by a particular token.
 String getProperty(String token)
          Retrieve a value by a particular token.
 String[] getPropertyKeys()
          Retrieve all property keys currently in use.
 void removeProperty(String token)
          Remove a value associated with a particular token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected org.apache.log4j.Category cat
Log4J category.


properties

protected Properties properties
properties table

Constructor Detail

PropertyContainerImpl

public PropertyContainerImpl()
Constructor for the PropertyContainerImpl object

Method Detail

addProperty

public void addProperty(Object value,
                        String token)
Add a property associated with a token name.
If the token already exists, the value will be replaced. If the token does not exist, it will be added with the value.

Specified by:
addProperty in interface PropertyContainer
Parameters:
value - is an object that cannot be null
token - is a key that can be used to retrieve the value

getProperty

public String getProperty(String token)
Retrieve a value by a particular token.

Specified by:
getProperty in interface PropertyContainer
Parameters:
token - is a key that can be used to retrieve the value
Returns:
String is the value associated with the token. It will not be null

getObject

public Object getObject(String token)
Retrieve a value by a particular token.

Specified by:
getObject in interface PropertyContainer
Parameters:
token - is a key that can be used to retrieve the value
Returns:
Object is the value associated with the token. It will not be null

getPropertyKeys

public String[] getPropertyKeys()
Retrieve all property keys currently in use.

Specified by:
getPropertyKeys in interface PropertyContainer
Returns:
String[] is an array of all valid token names

removeProperty

public void removeProperty(String token)
Remove a value associated with a particular token.

Specified by:
removeProperty in interface PropertyContainer
Parameters:
token - is a key associated with a value that was added


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.