T - the type of model objects this mapping can convert to and fromR - the type of a registry-like object capable of either registering or creating new model objects for mappings that need to know about such an object, if no registry
needs to be known, using Object for this type is finepublic interface BaseMapping<T,R>
| Modifier and Type | Field and Description |
|---|---|
static String |
JCR_TYPE_NAME_CONSTANT_NAME
Must match constant used by implementations to identify the JCR node name/type that this mapping represents.
|
| Modifier and Type | Method and Description |
|---|---|
Class<T> |
getModelClass()
Retrieves the Java class of the model object this BaseMapping deals with.
|
void |
initFrom(T model)
Initializes this BaseMapping from the data of the specified model object
|
T |
toModel(T initial,
R registry)
Converts this BaseMapping into a model object, creating a new one if needed or resetting the specified initial value to the persisted state.
|
static final String JCR_TYPE_NAME_CONSTANT_NAME
void initFrom(T model)
model - the model object to initialize fromT toModel(T initial, R registry)
initial - a potentially null initial value that will be reset to the persisted stateregistry - the registry associated with instances of the specified model typeCopyright © 2006-2014 GateIn. All Rights Reserved.