public class FormFactoryProviderTransitionProvider<T> extends java.lang.Object implements IndexTransitionProvider<FormOperations,T>, TransitionProvider<FormOperations,T>
Constructor and Description |
---|
FormFactoryProviderTransitionProvider(AppContext c,
java.lang.String target_name,
FormFactoryProvider<T> proviser) |
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(TransitionFactoryVisitor<R,T,FormOperations> vis)
Accept a
TransitionFactoryVisitor . |
boolean |
allowTransition(AppContext c,
T target,
FormOperations name)
Access control check.
|
boolean |
equals(java.lang.Object obj) |
AppContext |
getContext() |
java.lang.String |
getID(T target)
Get the id string for form posts from a target
|
FormOperations |
getIndexTransition()
Get the key for the default index transition.
|
<X extends ContentBuilder> |
getSummaryContent(AppContext c,
X cb,
T target)
Get target summary to be shown on transition page.
|
T |
getTarget(java.lang.String id)
Find target type by id string
|
java.lang.String |
getTargetName()
What is the name for this type of transition.
|
Transition<T> |
getTransition(T target,
FormOperations key)
Find a transition operator for this type by key.
|
java.util.Set<FormOperations> |
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.
|
int |
hashCode() |
FormOperations |
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.
|
public FormFactoryProviderTransitionProvider(AppContext c, java.lang.String target_name, FormFactoryProvider<T> proviser)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean allowTransition(AppContext c, T target, FormOperations name)
TransitionFactory
allowTransition
in interface TransitionFactory<FormOperations,T>
c
- AppContexttarget
- target objectname
- identifying key object for transitionpublic java.lang.String getID(T target)
TransitionProvider
getID
in interface TransitionProvider<FormOperations,T>
public <X extends ContentBuilder> X getSummaryContent(AppContext c, X cb, T target)
TransitionFactory
getSummaryContent
in interface TransitionFactory<FormOperations,T>
c
- AppContextcb
- ContentBuilderpublic T getTarget(java.lang.String id)
TransitionProvider
getTarget
in interface TransitionProvider<FormOperations,T>
public java.lang.String getTargetName()
TransitionFactory
TransitionServlet
The value can also be used as the user presented text for the type of object
in the title of the transition form page though this can be overridden by setting
target-name.transition_titlegetTargetName
in interface TransitionFactory<FormOperations,T>
public Transition<T> getTransition(T target, FormOperations key)
TransitionFactory
getTransition
in interface TransitionFactory<FormOperations,T>
target
- target (may be null)key
- keypublic java.util.Set<FormOperations> 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<FormOperations,T>
public FormOperations lookupTransition(T target, java.lang.String name)
TransitionFactory
lookupTransition
in interface TransitionFactory<FormOperations,T>
target
- (may be null)public AppContext getContext()
getContext
in interface Contexed
public FormOperations getIndexTransition()
IndexTransitionFactory
getIndexTransition
in interface IndexTransitionFactory<FormOperations,T>
public <R> R accept(TransitionFactoryVisitor<R,T,FormOperations> vis)
TransitionFactory
TransitionFactoryVisitor
.
Any code that depends on
the particular sub-interface of TransitionFactory
should implement TransitionFactoryVisitor
this ensures it will always
handle all possible sub-classes.accept
in interface TransitionFactory<FormOperations,T>
accept
in interface TransitionProvider<FormOperations,T>