|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jconfig.DefaultCategory
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.
| Constructor Summary | |
DefaultCategory(java.lang.String categoryName)
|
|
| 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 |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultCategory(java.lang.String categoryName)
categoryName - | Method Detail |
public Category setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
setProperty in interface CategorypropertyName - propertyValue - public java.lang.String getProperty(java.lang.String propertyName)
null if the property is not found.getProperty in interface Categorykey - the property key.
public java.lang.String getProperty(java.lang.String propertyName,
java.lang.String defaultValue)
getProperty in interface CategorypropertyName - The property name.defaultValue - The default value.public java.lang.String getCategoryName()
getCategoryName in interface Categorypublic void addCategoryListener(CategoryListener listener)
addCategoryListener in interface Categorylistener - The ConfigurationListenerpublic void removeCategoryListener(CategoryListener listener)
removeCategoryListener in interface Categorylistener - The ConfigurationListenerpublic void fireCategoryChangedEvent(CategoryChangedEvent event)
fireCategoryChangedEvent in interface Categoryevent - The ConfigurationChangedEventpublic java.util.Properties getProperties()
getProperties in interface Categorypublic java.lang.String[] getArray(java.lang.String key)
getArray in interface Category
public java.lang.String[] getArray(java.lang.String key,
java.lang.String[] defaultValue)
getArray in interface Category
public boolean getBooleanProperty(java.lang.String name,
boolean defaultValue)
getBooleanProperty in interface Categoryname - The name of the propertydefaultValue - The default value
public void setBooleanProperty(java.lang.String name,
boolean value)
setBooleanProperty in interface Categoryname - value -
public char getCharProperty(java.lang.String name,
char defaultValue)
getCharProperty in interface Categoryname - The name of the propertydefaultValue - The default value
public void setCharProperty(java.lang.String key,
char value)
setCharProperty in interface Categorystring - c -
public double getDoubleProperty(java.lang.String name,
double defaultValue)
getDoubleProperty in interface Categoryname - The name of the propertydefaultValue - The default value
public int getIntProperty(java.lang.String name,
int defaultValue)
getIntProperty in interface Categoryname - The name of the propertydefaultValue - The default value
public void setIntProperty(java.lang.String key,
int value)
setIntProperty in interface Categorystring - i -
public long getLongProperty(java.lang.String name,
long defaultValue)
getLongProperty in interface Categoryname - The name of the propertydefaultValue - The default value
public void setLongProperty(java.lang.String key,
long value)
setLongProperty in interface Categorystring - l - public java.lang.String getConfigurationName()
getConfigurationName in interface Categorypublic void setConfigurationName(java.lang.String configurationName)
setConfigurationName in interface CategoryconfigurationName - New value of property configurationName.
public void setDoubleProperty(java.lang.String key,
double value)
setDoubleProperty in interface Categorykey - value - public void addPropertyListener(PropertyListener listener)
PropertyChangedEvent.addPropertyListener in interface Categorylistener - public void removePropertyListener(PropertyListener listener)
PropertyChangedEvent.removePropertyListener in interface Categorylistener - public void firePropertyChangedEvent(PropertyChangedEvent event)
PropertyListeners of changes
to the property (added, removed, changed).firePropertyChangedEvent in interface Categoryevent - public void setExtendsCategory(java.lang.String extendsCategory)
setExtendsCategory in interface Categorypublic java.lang.String getExtendsCategory()
getExtendsCategory in interface Category
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||