Package com.bc.ceres.binding
Interface PropertySet
-
- All Superinterfaces:
PropertyChangeEmitter
- All Known Subinterfaces:
FigureStyle
- All Known Implementing Classes:
DefaultFigureStyle,PropertyContainer
public interface PropertySet extends PropertyChangeEmitter
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
PropertySetinterface is based on the well-known Property List design pattern.- Since:
- 0.10
- See Also:
Property
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProperties(Property... properties)Adds the given properties to this set.voidaddProperty(Property property)Adds a property to this set.PropertyDescriptorgetDescriptor(String name)Gets the descriptor for the named property.Property[]getProperties()Gets all properties currently contained in this set.PropertygetProperty(String name)Gets the named property.<T> TgetValue(String name)Gets 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.voidsetDefaultValues()Sets all properties to their default values.voidsetValue(String name, Object value)Sets the value of the named property.-
Methods inherited from interface com.bc.ceres.binding.PropertyChangeEmitter
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
getProperties
Property[] getProperties()
Gets all properties currently contained in this set.- Returns:
- The array of properties, which may be empty.
-
isPropertyDefined
boolean isPropertyDefined(String name)
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
Property getProperty(String name)
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:
isPropertyDefined(String),PropertyDescriptor.getAlias()
-
addProperty
void addProperty(Property property)
Adds a property to this set.- Parameters:
property- The property.
-
addProperties
void addProperties(Property... properties)
Adds the given properties to this set.- Parameters:
properties- The properties to be added.
-
removeProperty
void removeProperty(Property property)
Removes a property from this set.- Parameters:
property- The property.
-
removeProperties
void removeProperties(Property... properties)
Removes the given properties from this set.- Parameters:
properties- The properties to be removed.
-
getValue
<T> T getValue(String name) throws ClassCastException
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
void setValue(String name, Object value) throws IllegalArgumentException
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
void setDefaultValues() throws IllegalStateExceptionSets 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:
PropertyDescriptor.getDefaultValue()
-
getDescriptor
PropertyDescriptor getDescriptor(String name)
Gets the descriptor for the named property.- Parameters:
name- The property name (case sensitive).- Returns:
- The descriptor, or
nullif the property is unknown.
-
-