public abstract class UserPropertyInitializer extends PropertyInitializer
PropertyInitializer
specifically to provide a dynamic defaults for user defined properties.
Concrete subclasses of UserPropertyInitializer should be registered using
OfflineDBPropertyInitializationManager#registerPropertyInitializer
.PropertyInitializer.InitializationVeto
Modifier | Constructor and Description |
---|---|
protected |
UserPropertyInitializer(DBObjectProvider pro)
NB subclasses must provide a constructor that takes a DBObjectProvider
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getPropertyInitialValue(DBObject obj,
java.lang.String propertyName) |
java.lang.String[] |
getPropertyNames(java.lang.Class<? extends DBObject> clz) |
protected abstract java.lang.String |
getUserPropertyDefault(DBObject obj,
java.lang.String userPropertyName)
Concrete subclasses should return the default value of the user property
with the given name for the given DBObject or throw a
PropertyInitializer.InitializationVeto exception.
|
protected abstract java.lang.String[] |
getUserPropertyNames(java.lang.Class<? extends DBObject> clz)
Concrete subclasses should return a String[] of user property names for
objects of the given class for which they provide a default value.
|
getProvider
protected UserPropertyInitializer(DBObjectProvider pro)
public final java.lang.String[] getPropertyNames(java.lang.Class<? extends DBObject> clz)
getPropertyNames
in class PropertyInitializer
clz
- the class of object for which supported properties are being requested.public final java.lang.Object getPropertyInitialValue(DBObject obj, java.lang.String propertyName) throws PropertyInitializer.InitializationVeto
getPropertyInitialValue
in class PropertyInitializer
PropertyInitializer.InitializationVeto
protected abstract java.lang.String[] getUserPropertyNames(java.lang.Class<? extends DBObject> clz)
protected abstract java.lang.String getUserPropertyDefault(DBObject obj, java.lang.String userPropertyName) throws PropertyInitializer.InitializationVeto