|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class is the result of countless discussions of what a Category should be. After determing that it should be another class, and that we can do something useful, we created this Category. A Category is a logical extension of the Configuration has Categories has Properties has Value frame-of-mind. The primary goal is to reduce redundancy in source code when using setter and getters that include Category information.
Method Summary | |
void |
addCategoryListener(CategoryListener listener)
Adds the specified category listener to receive category changed events from this category. |
void |
addPropertyListener(PropertyListener listener)
Adds the given listener to the list that wish to receive the PropertyChangedEvent . |
void |
fireCategoryChangedEvent(CategoryChangedEvent event)
Deliver category changed event to all listeners that are registered with our listener list. |
void |
firePropertyChangedEvent(PropertyChangedEvent event)
Notifies all PropertyListeners of changes
to the property (added, removed, changed). |
java.lang.String[] |
getArray(java.lang.String key)
|
java.lang.String[] |
getArray(java.lang.String key,
java.lang.String[] defaultValue)
|
boolean |
getBooleanProperty(java.lang.String name,
boolean defaultValue)
Helper method to allow for strong-binding within Properties. |
java.lang.String |
getCategoryName()
Returns the name of this category. |
char |
getCharProperty(java.lang.String name,
char defaultValue)
Helper method to allow for strong-binding within Properties. |
java.lang.String |
getConfigurationName()
Getter for property configurationName. |
double |
getDoubleProperty(java.lang.String name,
double defaultValue)
Helper method to allow for strong-binding within Properties. |
java.lang.String |
getExtendsCategory()
|
int |
getIntProperty(java.lang.String name,
int defaultValue)
Helper method to allow for strong-binding within Properties. |
long |
getLongProperty(java.lang.String name,
long defaultValue)
Helper method to allow for strong-binding within Properties. |
java.util.Properties |
getProperties()
Return all properties related to this category |
java.lang.String |
getProperty(java.lang.String propertyName)
Searches for the property with the specified key in this property list. |
java.lang.String |
getProperty(java.lang.String propertyName,
java.lang.String defaultValue)
Searches for the property with the specified key in this property list. |
void |
removeCategoryListener(CategoryListener listener)
Removes the specified category listener from the category change events from this category. |
void |
removePropertyListener(PropertyListener listener)
Removes the given listener to the list that wish to receive the PropertyChangedEvent . |
void |
renameCategory(java.lang.String name)
This method will change the name of the category. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Helper method to allow for strong-binding within Properties. |
void |
setCharProperty(java.lang.String key,
char value)
Helper method to allow for strong-binding within Properties. |
void |
setConfigurationName(java.lang.String configurationName)
Setter for property configurationName. |
void |
setDoubleProperty(java.lang.String key,
double value)
Helper method to allow for strong-binding within Properties. |
void |
setExtendsCategory(java.lang.String extendsCategory)
|
void |
setIntProperty(java.lang.String key,
int value)
Helper method to allow for strong-binding within Properties. |
void |
setLongProperty(java.lang.String key,
long value)
Helper method to allow for strong-binding within Properties. |
Category |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Sets the property with the value given. |
Method Detail |
public Category setProperty(java.lang.String propertyName, java.lang.String propertyValue)
propertyName
- propertyValue
-
public java.lang.String getProperty(java.lang.String propertyName)
null
if the property is not found.
propertyName
- the property key.
public java.lang.String getProperty(java.lang.String propertyName, java.lang.String defaultValue)
propertyName
- The property name.defaultValue
- The default value.
public java.lang.String getCategoryName()
public void addCategoryListener(CategoryListener listener)
listener
- The ConfigurationListenerpublic void removeCategoryListener(CategoryListener listener)
listener
- The ConfigurationListenerpublic void fireCategoryChangedEvent(CategoryChangedEvent event)
event
- The ConfigurationChangedEventpublic java.util.Properties getProperties()
public java.lang.String[] getArray(java.lang.String key)
public java.lang.String[] getArray(java.lang.String key, java.lang.String[] defaultValue)
public boolean getBooleanProperty(java.lang.String name, boolean defaultValue)
name
- The name of the propertydefaultValue
- The default value
public void setBooleanProperty(java.lang.String name, boolean value)
name
- value
- public char getCharProperty(java.lang.String name, char defaultValue)
name
- The name of the propertydefaultValue
- The default value
public void setCharProperty(java.lang.String key, char value)
key
- value
- public double getDoubleProperty(java.lang.String name, double defaultValue)
name
- The name of the propertydefaultValue
- The default value
public int getIntProperty(java.lang.String name, int defaultValue)
name
- The name of the propertydefaultValue
- The default value
public void setIntProperty(java.lang.String key, int value)
key
- value
- public long getLongProperty(java.lang.String name, long defaultValue)
name
- The name of the propertydefaultValue
- The default value
public void setLongProperty(java.lang.String key, long value)
key
- value
- public java.lang.String getConfigurationName()
public void setConfigurationName(java.lang.String configurationName)
configurationName
- New value of property configurationName.public void setDoubleProperty(java.lang.String key, double value)
key
- value
- public void addPropertyListener(PropertyListener listener)
PropertyChangedEvent
.
listener
- public void removePropertyListener(PropertyListener listener)
PropertyChangedEvent
.
listener
- public void firePropertyChangedEvent(PropertyChangedEvent event)
PropertyListeners
of changes
to the property (added, removed, changed).
event
- public void setExtendsCategory(java.lang.String extendsCategory)
extendsCategory
- public java.lang.String getExtendsCategory()
public void renameCategory(java.lang.String name)
name
- the new name of the category
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |