public class Property
extends java.lang.Object
Constructor and Description |
---|
Property(java.lang.Class<? extends Configuration> configurationClass,
java.lang.String propertyID)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Method |
getGetter()
Returns the getter method for this property.
|
java.lang.String |
getName()
Returns the (human readable) name of the property.
|
java.lang.reflect.Method |
getSetter()
Returns the setter method for this property.
|
java.lang.Class<?> |
getType()
Returns the property type.
|
java.lang.Object |
getValue(Configuration configuration)
Returns the value of the property.
|
<T> T |
getValue(Configuration configuration,
java.lang.Class<T> valueType)
Returns the value of this property, cased to a specific class.
|
boolean |
isConditionalFulfilled(Configuration configuration)
Checks if conditional function for property to make sense to add to UI is fulfilled.
|
boolean |
isVisible()
Returns true if property should be shown in configuration.
|
void |
setValue(Configuration configuration,
java.lang.Object value)
Sets the value of the property.
|
public Property(java.lang.Class<? extends Configuration> configurationClass, java.lang.String propertyID) throws GenericException
configurationClass
- The class of the configuration of which this is a property.propertyID
- The ID/name of the property.GenericException
public boolean isVisible()
public java.lang.reflect.Method getGetter()
public java.lang.reflect.Method getSetter()
public java.lang.String getName()
public java.lang.Class<?> getType()
public java.lang.Object getValue(Configuration configuration) throws GenericException
getType()
configuration
- The configuration for which the value of the property should be returned.GenericException
public boolean isConditionalFulfilled(Configuration configuration) throws GenericException
configuration
- The configuration for which the value of the property should be returned.GenericException
public <T> T getValue(Configuration configuration, java.lang.Class<T> valueType) throws GenericException
configuration
- The configuration for which the value of the property should be returned.valueType
- class of property.GenericException
public void setValue(Configuration configuration, java.lang.Object value) throws GenericException
configuration
- Configuration in which the value should be set.value
- Value which should be set. Should have the correct type.GenericException