ca.nengo.config.impl
Class TemplateProperty
java.lang.Object
ca.nengo.config.impl.AbstractProperty
ca.nengo.config.impl.TemplateProperty
- All Implemented Interfaces:
- Property, SingleValuedProperty
public class TemplateProperty
- extends AbstractProperty
- implements SingleValuedProperty
A SingleValuedProperty that is not attached to getter/setter methods on an underlying class, but instead stores
its value internally. It can be used to manage values of constructor/method arguments (rather than object properties).
- Author:
- Bryan Tripp
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateProperty
public TemplateProperty(Configuration configuration,
java.lang.String name,
java.lang.Class<?> c,
java.lang.Object defaultValue)
- Parameters:
configuration - Configuration to which this Property belongsname - Name of the propertyc - Type of the property valuedefaultValue - Default property value
getValue
public java.lang.Object getValue()
- Specified by:
getValue in interface SingleValuedProperty
- Returns:
- Value (for single-valued properties) or first value (for multi-valued properties)
- See Also:
SingleValuedProperty.getValue()
isFixedCardinality
public boolean isFixedCardinality()
- Specified by:
isFixedCardinality in interface Property
- Returns:
- True if the property has a fixed number of values
- See Also:
Property.isFixedCardinality()
setValue
public void setValue(java.lang.Object value)
throws StructuralException
- Specified by:
setValue in interface SingleValuedProperty
- Parameters:
value - New value (for single-valued properties) or first value (for multi-valued properties)
- Throws:
StructuralException - if the given value is not one of the allowed classes, or if the
Configurable rejects it for any other reason (eg inconsistency with other properties)- See Also:
SingleValuedProperty.setValue(java.lang.Object)