|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.betwixt.strategy.IdStoringStrategy
public abstract class IdStoringStrategy
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.
Field Summary | |
---|---|
static IdStoringStrategy |
DEFAULT
Deprecated. do not use this singleton since it creates a static Map of all objects ever written. Use createDefault() instead |
Constructor Summary | |
---|---|
IdStoringStrategy()
|
Method Summary | |
---|---|
static IdStoringStrategy |
createDefault()
Factory method creates the default Betwixt implementation. |
abstract java.lang.Object |
getReferenced(Context context,
java.lang.String id)
Gets an object matching the given reference. |
abstract java.lang.String |
getReferenceFor(Context context,
java.lang.Object bean)
Retrieves a reference for the given instance. |
abstract void |
reset()
Reset to the initial state. |
abstract void |
setReference(Context context,
java.lang.Object bean,
java.lang.String id)
Stores an instance reference for later retrieval. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static IdStoringStrategy DEFAULT
createDefault()
instead
Constructor Detail |
---|
public IdStoringStrategy()
Method Detail |
---|
public static IdStoringStrategy createDefault()
Betwixt
implementation.
The implementation created may vary if the default implementation changes.
IdStoringStrategy
used as defaultpublic abstract java.lang.String getReferenceFor(Context context, java.lang.Object bean)
IDGenerator
strategy to vary the values
written for a bean.
context
- current context, not nullbean
- the instance, not null
public abstract void setReference(Context context, java.lang.Object bean, java.lang.String id)
context
- current context, not nullbean
- the instance, not nullid
- the id to usepublic abstract java.lang.Object getReferenced(Context context, java.lang.String id)
context
- Context
, not nullid
- the reference id
public abstract void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |