| java.lang.Object org.apache.commons.betwixt.strategy.IdStoringStrategy
All known Subclasses: org.apache.commons.betwixt.strategy.DefaultIdStoringStrategy,
IdStoringStrategy | abstract public class IdStoringStrategy (Code) | | Pluggable strategy for id storage management.
It is possible to use this strategy for innovative
active storage storage strategies as well as passive ones.
For example, it is possible to have some beans map to
references without ever being fully mapped.
author: Christian Aust since: 0.7 |
createDefault | public static IdStoringStrategy createDefault()(Code) | | Factory method creates the default Betwixt implementation.
The implementation created may vary if the default implementation changes.
IdStoringStrategy used as default since: 0.8 |
getReferenceFor | abstract public String getReferenceFor(Context context, Object bean)(Code) | | Retrieves a reference for the given instance.
If a not null value is returned from this method,
then the bean content will not be written.
Use
org.apache.commons.betwixt.io.IDGenerator strategy to vary the values
written for a bean.
Parameters: context - current context, not null Parameters: bean - the instance, not null id as String when this bean has already been reference, or null to indicate that this bean is not yet reference |
getReferenced | abstract public Object getReferenced(Context context, String id)(Code) | | Gets an object matching the given reference.
Parameters: context - Context , not null Parameters: id - the reference id an bean matching the given reference, or null if there is no bean matching the given reference |
reset | abstract public void reset()(Code) | | Reset to the initial state.
|
setReference | abstract public void setReference(Context context, Object bean, String id)(Code) | | Stores an instance reference for later retrieval.
This method is shared by writing and reading.
Parameters: context - current context, not null Parameters: bean - the instance, not null Parameters: id - the id to use |
|
|