public class SingleValuedPropertyImpl extends AbstractProperty implements SingleValuedProperty
Constructor and Description |
---|
SingleValuedPropertyImpl(Configuration configuration,
java.lang.String name,
java.lang.Class<?> c,
java.lang.reflect.Method getter)
Constructor for immutable single-valued properties.
|
SingleValuedPropertyImpl(Configuration configuration,
java.lang.String name,
java.lang.Class<?> c,
java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
Constructor for mutable single-valued properties.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDocumentation() |
static SingleValuedProperty |
getSingleValuedProperty(Configuration configuration,
java.lang.String name,
java.lang.Class<?> type) |
java.lang.Object |
getValue() |
boolean |
isFixedCardinality() |
void |
setValue(java.lang.Object value)
By default, attempts to call method setX(y) on Configurable, where X is the name of the property (with
first letter capitalized) and y is the value (changed to a primitive if it's a primitive wrapper).
|
getConfiguration, getDefaultDocumentation, getName, getType, isMutable, setDocumentation, setName
public SingleValuedPropertyImpl(Configuration configuration, java.lang.String name, java.lang.Class<?> c, java.lang.reflect.Method getter)
configuration
- Configuration to which this Property belongsname
- Parameter namec
- Parameter typegetter
- Zero-arg getter methodpublic SingleValuedPropertyImpl(Configuration configuration, java.lang.String name, java.lang.Class<?> c, java.lang.reflect.Method getter, java.lang.reflect.Method setter)
configuration
- Configuration to which this Property belongsname
- Parameter namec
- Parameter typegetter
- Zero-arg getter methodsetter
- Single-arg setter methodpublic static SingleValuedProperty getSingleValuedProperty(Configuration configuration, java.lang.String name, java.lang.Class<?> type)
configuration
- Configuration to which this Property belongsname
- Parameter nametype
- Parameter typepublic 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)
public java.lang.String getDocumentation()
getDocumentation
in interface Property
getDocumentation
in class AbstractProperty
Property.getDocumentation()