T
- the type of the property valuepublic abstract class GenericProperty<T> extends Object implements Property<T>
Constructor and Description |
---|
GenericProperty(String propertyName,
Class<T> propertyType)
Creates a new property object.
|
Modifier and Type | Method and Description |
---|---|
void |
clearValue(DataContainer dataContainer,
PropertyHolder holder) |
void |
clearValue(DataContainer dataContainer,
String nodeId) |
void |
clearValue(PropertyHolder holder) |
boolean |
copyValue(DataContainer dataContainer,
Node fromNode,
Node toNode,
T defaultValue)
Copy a property from one to another nodeId.
|
boolean |
copyValue(DataContainer dataContainer,
String fromId,
String toId,
T defaultValue) |
T |
ensureValue(DataContainer dataContainer,
PropertyHolder holder)
Ensure a value, using whatever default should be used for this property.
|
T |
ensureValue(DataContainer dataContainer,
PropertyHolder holder,
T defaultValue) |
T |
ensureValue(DataContainer dataContainer,
String nodeId)
Ensures a value, using the default value defined by this property.
|
T |
ensureValue(DataContainer dataContainer,
String nodeId,
T defaultValue)
Ensure a value is set.
|
String |
getPropertyName() |
Class<?> |
getPropertyType() |
String |
getStringValue(DataContainer dataContainer,
PropertyHolder holder) |
String |
getStringValue(DataContainer dataContainer,
PropertyHolder holder,
String defaultValue) |
String |
getStringValue(DataContainer dataContainer,
String nodeId) |
String |
getStringValue(DataContainer dataContainer,
String nodeId,
String defaultValue) |
T |
getValue(DataContainer dataContainer,
PropertyHolder holder)
Default implementation throws an Exception.
|
T |
getValue(DataContainer dataContainer,
PropertyHolder holder,
T defaultValue) |
T |
getValue(DataContainer dataContainer,
String nodeId)
Default implementation throws an Exception.
|
T |
getValue(DataContainer dataContainer,
String nodeId,
T defaultValue) |
T |
getValue(PropertyHolder holder) |
T |
getValue(PropertyHolder holder,
T defaultValue) |
boolean |
isSet(DataContainer dataContainer,
PropertyHolder propertyHolder) |
boolean |
isSet(DataContainer dataContainer,
String nodeId) |
boolean |
isSet(PropertyHolder holder) |
void |
restoreValue(DataContainer dataContainer,
PropertyHolder holder)
Restores a value from a DataContainer back into the element.
|
void |
restoreValue(DataContainer dataContainer,
PropertyHolder holder,
T defaultValue)
Restore a value from the dataContainer to the element.
|
void |
setStringValue(DataContainer dataContainer,
PropertyHolder holder,
String value) |
void |
setStringValue(DataContainer dataContainer,
String nodeId,
String value) |
void |
setValue(DataContainer dataContainer,
PropertyHolder holder) |
void |
setValue(DataContainer dataContainer,
PropertyHolder holder,
T value) |
void |
setValue(DataContainer dataContainer,
String nodeId,
T value) |
void |
setValue(PropertyHolder holder,
T value) |
public String getPropertyName()
getPropertyName
in interface Property<T>
public Class<?> getPropertyType()
getPropertyType
in interface Property<T>
public boolean isSet(PropertyHolder holder)
public boolean isSet(DataContainer dataContainer, PropertyHolder propertyHolder)
public boolean isSet(DataContainer dataContainer, String nodeId)
public T getValue(PropertyHolder holder)
public T getValue(PropertyHolder holder, T defaultValue)
public String getStringValue(DataContainer dataContainer, PropertyHolder holder)
getStringValue
in interface Property<T>
public String getStringValue(DataContainer dataContainer, String nodeId)
getStringValue
in interface Property<T>
public String getStringValue(DataContainer dataContainer, PropertyHolder holder, String defaultValue)
getStringValue
in interface Property<T>
public String getStringValue(DataContainer dataContainer, String nodeId, String defaultValue)
getStringValue
in interface Property<T>
public void setValue(PropertyHolder holder, T value)
public void setValue(DataContainer dataContainer, PropertyHolder holder)
public void setValue(DataContainer dataContainer, PropertyHolder holder, T value)
public void setValue(DataContainer dataContainer, String nodeId, T value)
public void setStringValue(DataContainer dataContainer, PropertyHolder holder, String value)
setStringValue
in interface Property<T>
public void setStringValue(DataContainer dataContainer, String nodeId, String value)
setStringValue
in interface Property<T>
public void clearValue(PropertyHolder holder)
clearValue
in interface Property<T>
public void clearValue(DataContainer dataContainer, PropertyHolder holder)
clearValue
in interface Property<T>
public void clearValue(DataContainer dataContainer, String nodeId)
clearValue
in interface Property<T>
public T getValue(DataContainer dataContainer, PropertyHolder holder)
public T getValue(DataContainer dataContainer, String nodeId)
public T getValue(DataContainer dataContainer, PropertyHolder holder, T defaultValue)
public T getValue(DataContainer dataContainer, String nodeId, T defaultValue)
public void restoreValue(DataContainer dataContainer, PropertyHolder holder)
Property
restoreValue
in interface Property<T>
getValue
public void restoreValue(DataContainer dataContainer, PropertyHolder holder, T defaultValue)
restoreValue
in interface Property<T>
public T ensureValue(DataContainer dataContainer, PropertyHolder holder)
public T ensureValue(DataContainer dataContainer, String nodeId)
UnsupportedOperationException
public T ensureValue(DataContainer dataContainer, PropertyHolder holder, T defaultValue)
public T ensureValue(DataContainer dataContainer, String nodeId, T defaultValue)
public boolean copyValue(DataContainer dataContainer, Node fromNode, Node toNode, T defaultValue)
defaultValue
- the value to use if fromNode does not contain a value for given property.
If defaultValue is null and fromNode does not contain a value then nothing
will be copied.public boolean copyValue(DataContainer dataContainer, String fromId, String toId, T defaultValue)
Copyright © 2013. All Rights Reserved.