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).
Constructor and Description |
---|
TemplateProperty(Configuration configuration,
java.lang.String name,
java.lang.Class<?> c,
java.lang.Object defaultValue) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue() |
boolean |
isFixedCardinality() |
void |
setValue(java.lang.Object value) |
getConfiguration, getDefaultDocumentation, getDocumentation, getName, getType, isMutable, setDocumentation, setName
public TemplateProperty(Configuration configuration, java.lang.String name, java.lang.Class<?> c, java.lang.Object defaultValue)
configuration
- Configuration to which this Property belongsname
- Name of the propertyc
- Type of the property valuedefaultValue
- Default property valuepublic java.lang.Object getValue()
getValue
in interface SingleValuedProperty
SingleValuedProperty.getValue()
public boolean isFixedCardinality()
isFixedCardinality
in interface Property
Property.isFixedCardinality()
public void setValue(java.lang.Object value) throws StructuralException
setValue
in interface SingleValuedProperty
value
- New value (for single-valued properties) or first value (for multi-valued properties)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)SingleValuedProperty.setValue(java.lang.Object)