Package com.bc.ceres.binding
Interface PropertySet
- All Superinterfaces:
PropertyChangeEmitter
- All Known Subinterfaces:
FigureStyle
- All Known Implementing Classes:
DefaultFigureStyle,PropertyContainer
A loose aggregation of properties. Properties can be added to and removed from this set.
Property change events are fired whenever property values change.
The PropertySet interface is based on the well-known Property List design pattern.
- Since:
- 0.10
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperties(Property... properties) Adds the given properties to this set.voidaddProperty(Property property) Adds a property to this set.getDescriptor(String name) Gets the descriptor for the named property.Property[]Gets all properties currently contained in this set.getProperty(String name) Gets the named property.<T> TGets the value of the named property.booleanisPropertyDefined(String name) Tests if the named property is defined in this set.voidremoveProperties(Property... properties) Removes the given properties from this set.voidremoveProperty(Property property) Removes a property from this set.voidSets all properties to their default values.voidSets the value of the named property.Methods inherited from interface com.bc.ceres.binding.PropertyChangeEmitter
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
Method Details
-
getProperties
Property[] getProperties()Gets all properties currently contained in this set.- Returns:
- The array of properties, which may be empty.
-
isPropertyDefined
Tests if the named property is defined in this set. For undefined properties, the methodgetProperty(name)will always returnnull.- Parameters:
name- The property name or the property's alias name (both case sensitive).- Returns:
trueif the property is defined.
-
getProperty
Gets the named property.- Parameters:
name- The property name or the property's alias name (both case sensitive).- Returns:
- The property, or
nullif the property does not exist. - See Also:
-
addProperty
Adds a property to this set.- Parameters:
property- The property.
-
addProperties
Adds the given properties to this set.- Parameters:
properties- The properties to be added.
-
removeProperty
Removes a property from this set.- Parameters:
property- The property.
-
removeProperties
Removes the given properties from this set.- Parameters:
properties- The properties to be removed.
-
getValue
Gets the value of the named property.- Parameters:
name- The property name.- Returns:
- The property value or
nullif a property with the given name does not exist. - Throws:
ClassCastException- if the value is not of the requested type.
-
setValue
Sets the value of the named property.- Parameters:
name- The property name.value- The new property value.- Throws:
IllegalArgumentException- If the value is illegal. The cause will always be aValidationException.
-
setDefaultValues
Sets all properties to their default values.- Throws:
IllegalStateException- If at least one of the default values is illegal. The cause will always be aValidationException.- Since:
- Ceres 0.12
- See Also:
-
getDescriptor
Gets the descriptor for the named property.- Parameters:
name- The property name (case sensitive).- Returns:
- The descriptor, or
nullif the property is unknown.
-