|
||||||||||
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 Category
propertyName
- propertyValue
- public java.lang.String getProperty(java.lang.String propertyName)
null
if the property is not found.getProperty
in interface Category
key
- the property key.public java.lang.String getProperty(java.lang.String propertyName, java.lang.String defaultValue)
getProperty
in interface Category
propertyName
- The property name.defaultValue
- The default value.public java.lang.String getCategoryName()
getCategoryName
in interface Category
public void addCategoryListener(CategoryListener listener)
addCategoryListener
in interface Category
listener
- The ConfigurationListenerpublic void removeCategoryListener(CategoryListener listener)
removeCategoryListener
in interface Category
listener
- The ConfigurationListenerpublic void fireCategoryChangedEvent(CategoryChangedEvent event)
fireCategoryChangedEvent
in interface Category
event
- The ConfigurationChangedEventpublic java.util.Properties getProperties()
getProperties
in interface Category
public 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 Category
name
- The name of the propertydefaultValue
- The default valuepublic void setBooleanProperty(java.lang.String name, boolean value)
setBooleanProperty
in interface Category
name
- value
- public char getCharProperty(java.lang.String name, char defaultValue)
getCharProperty
in interface Category
name
- The name of the propertydefaultValue
- The default valuepublic void setCharProperty(java.lang.String key, char value)
setCharProperty
in interface Category
string
- c
- public double getDoubleProperty(java.lang.String name, double defaultValue)
getDoubleProperty
in interface Category
name
- The name of the propertydefaultValue
- The default valuepublic int getIntProperty(java.lang.String name, int defaultValue)
getIntProperty
in interface Category
name
- The name of the propertydefaultValue
- The default valuepublic void setIntProperty(java.lang.String key, int value)
setIntProperty
in interface Category
string
- i
- public long getLongProperty(java.lang.String name, long defaultValue)
getLongProperty
in interface Category
name
- The name of the propertydefaultValue
- The default valuepublic void setLongProperty(java.lang.String key, long value)
setLongProperty
in interface Category
string
- l
- public java.lang.String getConfigurationName()
getConfigurationName
in interface Category
public void setConfigurationName(java.lang.String configurationName)
setConfigurationName
in interface Category
configurationName
- New value of property configurationName.public void setDoubleProperty(java.lang.String key, double value)
setDoubleProperty
in interface Category
key
- value
- public void addPropertyListener(PropertyListener listener)
PropertyChangedEvent
.addPropertyListener
in interface Category
listener
- public void removePropertyListener(PropertyListener listener)
PropertyChangedEvent
.removePropertyListener
in interface Category
listener
- public void firePropertyChangedEvent(PropertyChangedEvent event)
PropertyListeners
of changes
to the property (added, removed, changed).firePropertyChangedEvent
in interface Category
event
- public void setExtendsCategory(java.lang.String extendsCategory)
setExtendsCategory
in interface Category
public java.lang.String getExtendsCategory()
getExtendsCategory
in interface Category
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |