T
- K
- public abstract class AbstractTransitionFactory<T,K extends TransitionKey<T>> extends AbstractContexed implements ContextCached, TransitionFactory<K,T>
TransitionFactory
s.
This implementation stores the keys and transitions in maps generated when the class is constructed
so dynamic transitions are not supported.conn
Constructor and Description |
---|
AbstractTransitionFactory(AppContext c) |
Modifier and Type | Method and Description |
---|---|
void |
addTransition(K key,
Transition<T> t)
Register a new transition with the provider.
|
Transition<T> |
getTransition(K name) |
Transition<T> |
getTransition(T target,
K name)
Find a transition operator for this type by key.
|
java.util.Set<K> |
getTransitions(T target)
Get a list of all the transition keys supported by the target type to be presented to the user
as a set of possible options in a view transition.
|
K |
lookupTransition(T target,
java.lang.String name)
Lookup a transition key by String
This has to be the same as the result of the toString method
on the key as this is what is passed from transitions.jsp for a form transition.
|
protected boolean |
sortByKey() |
getContext, getLogger, resetLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept, allowTransition, getSummaryContent, getTargetName
getContext
public AbstractTransitionFactory(AppContext c)
protected boolean sortByKey()
public final void addTransition(K key, Transition<T> t)
key
- t
- public final K lookupTransition(T target, java.lang.String name)
TransitionFactory
lookupTransition
in interface TransitionFactory<K extends TransitionKey<T>,T>
target
- (may be null)public final Transition<T> getTransition(T target, K name)
TransitionFactory
getTransition
in interface TransitionFactory<K extends TransitionKey<T>,T>
target
- target (may be null)name
- keypublic final Transition<T> getTransition(K name)
public final java.util.Set<K> getTransitions(T target)
TransitionFactory
TransitionFactory.allowTransition(AppContext, Object, Object)
will not be presented.
Additional hidden operations may also be supported but these will never be presented to the user
as options and can only generated as a ChainedTransitionResult
.
In most cases the transition set will be the same for all null/non-null targets
though in principal dynamic transitions could be generated based on the state of the target e.g. a parameterised
transition with the parameter encoded in the key.getTransitions
in interface TransitionFactory<K extends TransitionKey<T>,T>