Class DefaultPageFlow
- java.lang.Object
-
- org.onehippo.forge.pageflow.core.rt.impl.DefaultPageFlow
-
- All Implemented Interfaces:
Serializable
,PageFlow
public class DefaultPageFlow extends Object implements PageFlow
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultPageFlow(String id, org.springframework.statemachine.StateMachine<PageState,String> stateMachine)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Compares the specified object with thisPageFlow
for equality.Object
getAttribute(String name)
Find and return the attribute model object of thisPageFlow
by thename
.Map<String,Object>
getAttributeMap()
Return an unmodifiable attributes map of thisPageFlow
.String
getId()
Return the identifier of thePageFlow
instance.PageState
getPageState()
Return the currentPageState
instance in thePageFlow
.List<PageState>
getPageStates()
Return an unmodifiable list of thePageState
of thisPageFlow
.int
hashCode()
Returns the hash code value for thisPageFlow
.boolean
isComplete()
Return true if thisPageFlow
instance is completed.boolean
isStarted()
Return true if thisPageFlow
instance has started.boolean
isStopped()
Return true if thisPageFlow
instance has stopped.void
sendEvent(String event)
Send an event to thePageFlow
, which might cause a Page Transition as a result.void
setAttribute(String name, Object model)
Set the attribute by thename
on thisPageFlow
.void
start()
Start thisPageFlow
instance.void
stop()
Stop thisPageFlow
instance.String
toString()
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:PageFlow
Return the identifier of thePageFlow
instance.
-
isStarted
public boolean isStarted()
Description copied from interface:PageFlow
Return true if thisPageFlow
instance has started.
-
start
public void start() throws PageFlowException
Description copied from interface:PageFlow
Start thisPageFlow
instance.- Specified by:
start
in interfacePageFlow
- Throws:
PageFlowException
- if it can't start
-
isStopped
public boolean isStopped()
Description copied from interface:PageFlow
Return true if thisPageFlow
instance has stopped.
-
stop
public void stop() throws PageFlowException
Description copied from interface:PageFlow
Stop thisPageFlow
instance.- Specified by:
stop
in interfacePageFlow
- Throws:
PageFlowException
- if it can't stop
-
isComplete
public boolean isComplete() throws PageFlowException
Description copied from interface:PageFlow
Return true if thisPageFlow
instance is completed.- Specified by:
isComplete
in interfacePageFlow
- Returns:
- true if this
PageFlow
instance is completed - Throws:
PageFlowException
- if any exception occurs
-
getPageState
public PageState getPageState() throws PageFlowException
Description copied from interface:PageFlow
Return the currentPageState
instance in thePageFlow
.- Specified by:
getPageState
in interfacePageFlow
- Returns:
- the current
PageState
instance in thePageFlow
- Throws:
PageFlowException
- if any exception occurs
-
sendEvent
public void sendEvent(String event) throws PageFlowException
Description copied from interface:PageFlow
Send an event to thePageFlow
, which might cause a Page Transition as a result.- Specified by:
sendEvent
in interfacePageFlow
- Parameters:
event
- event- Throws:
PageFlowException
- if any exception occurs
-
getPageStates
public List<PageState> getPageStates() throws PageFlowException
Description copied from interface:PageFlow
Return an unmodifiable list of thePageState
of thisPageFlow
.- Specified by:
getPageStates
in interfacePageFlow
- Returns:
- an unmodifiable list of the
PageState
of thisPageFlow
- Throws:
PageFlowException
- if any exception occurs
-
getAttribute
public Object getAttribute(String name) throws PageFlowException
Description copied from interface:PageFlow
Find and return the attribute model object of thisPageFlow
by thename
. Return null if not found.- Specified by:
getAttribute
in interfacePageFlow
- Parameters:
name
- attribute name- Returns:
- the attribute model object of this
PageFlow
by thename
, null if not found - Throws:
PageFlowException
- if any exception occurs
-
setAttribute
public void setAttribute(String name, Object model) throws PageFlowException
Description copied from interface:PageFlow
Set the attribute by thename
on thisPageFlow
.- Specified by:
setAttribute
in interfacePageFlow
- Parameters:
name
- attribute namemodel
- attribute model object- Throws:
PageFlowException
- if any exception occurs
-
getAttributeMap
public Map<String,Object> getAttributeMap() throws PageFlowException
Description copied from interface:PageFlow
Return an unmodifiable attributes map of thisPageFlow
.- Specified by:
getAttributeMap
in interfacePageFlow
- Returns:
- an unmodifiable attributes map of this
PageFlow
- Throws:
PageFlowException
- if any exception occurs
-
equals
public boolean equals(Object o)
Description copied from interface:PageFlow
Compares the specified object with thisPageFlow
for equality.
-
hashCode
public int hashCode()
Description copied from interface:PageFlow
Returns the hash code value for thisPageFlow
.
-
-