public interface PropertyTypeConverter
Modifier and Type | Method and Description |
---|---|
Serializable |
constructInstance(String clazzName)
Construct an instance of an object that was deemed to be
PropertyValueEntity.PersistedType.CONSTRUCTABLE . |
<T> T |
convert(Class<T> targetClass,
Serializable value)
Convert a value to a given type.
|
PropertyValueEntity.PersistedType |
getPersistentType(Serializable value)
When external to persisted type mappings are not obvious, the persistence framework,
before persisting as
PropertyValueEntity.PersistedType.SERIALIZABLE , will give the converter
a chance to choose how the value must be persisted:
PropertyValueEntity.PersistedType.LONG
PropertyValueEntity.PersistedType.DOUBLE
PropertyValueEntity.PersistedType.STRING
PropertyValueEntity.PersistedType.SERIALIZABLE
PropertyValueEntity.PersistedType.CONSTRUCTABLE
The converter should return PropertyValueEntity.PersistedType.SERIALIZABLE if no further conversions
are possible. |
PropertyValueEntity.PersistedType getPersistentType(Serializable value)
PropertyValueEntity.PersistedType.SERIALIZABLE
, will give the converter
a chance to choose how the value must be persisted:
PropertyValueEntity.PersistedType.LONG
PropertyValueEntity.PersistedType.DOUBLE
PropertyValueEntity.PersistedType.STRING
PropertyValueEntity.PersistedType.SERIALIZABLE
PropertyValueEntity.PersistedType.CONSTRUCTABLE
PropertyValueEntity.PersistedType.SERIALIZABLE
if no further conversions
are possible. Implicit in the return value is the converter's ability to do the
conversion when required.
If the converter can fully reconstruct an equal instance using just the name of the value's
class, then PropertyValueEntity.PersistedType.CONSTRUCTABLE
can be used.value
- the value that does not have an obvious persistence slot<T> T convert(Class<T> targetClass, Serializable value)
targetClass
- the desired type to convert tovalue
- the value to convertSerializable constructInstance(String clazzName)
PropertyValueEntity.PersistedType.CONSTRUCTABLE
.clazzName
- the name of the classCopyright © 2005–2017 Alfresco Software. All rights reserved.