org.apache.commons.scaffold.util
Class ProcessResultBase

java.lang.Object
  extended by org.apache.commons.scaffold.util.ProcessResultBase
All Implemented Interfaces:
ProcessResult

public class ProcessResultBase
extends Object
implements ProcessResult

Concrete implementation of ProcessResult that can be used "as-is" to manage a response from the business tier.

Version:
$Revision: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
Author:
Ted Husted, Synthis Corporation

Field Summary
protected  boolean aggregate
          Field to store the aggregate state [false].
protected  Scroller scroller
          Our scroller object for paging through lists.
 
Constructor Summary
ProcessResultBase()
          Default constructor.
ProcessResultBase(Object data)
          Convenience constructor to set result object.
ProcessResultBase(Object data, boolean singleForm)
          Convenience constructor to set result object and singleForm status.
ProcessResultBase(String dispatch)
          Convenience constructor to set forwarding advice.
 
Method Summary
 boolean addMessage(Object message)
          Add a message to the list.
 Object getData()
          Return the data object.
 String getDispatch()
          The dispatch property can be used to re-route control to an non-default location, either as a system path or via a logical name (e.g ActionForward).
 List getMessages()
          Return the messages list (an ArrayList).
 String getName()
          Return the attribute name for the result object.
 String getScope()
          Return the scope under which to store this result object.
 Scroller getScroller()
           
 boolean isAggregate()
          Return whether the result of this ProcessResult is a collection of contains other ProcessResult objects to be handled individually.
 boolean isData()
          Return whether data object has been set.
 boolean isDispatch()
          Return whether dispatch advice has been set.
 boolean isDispatchPath()
          Return whether dispatch advice is suppose to be a path or a token (e.g.
 boolean isExposed()
          Return the exposed state.
 boolean isMessages()
          Return whether there are any messages queued.
 boolean isSingleForm()
          Return the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.
 void setAggregate(boolean aggregate)
          Assign a new container state.
 void setData(Object data)
          Assign a new data object.
 void setDispatch(String dispatch)
          Set the dispatch advice.
 void setDispatchPath(boolean dispatchPath)
          Set the dispatchPath state.
 void setExposed(boolean exposed)
          Indicates whether the result should be exposed to the rest of the application through a context.
 void setMessages(List messages)
          Set a new list of messages.
 void setName(String name)
          Set the attribute name for this result object.
 void setScope(String scope)
          Set the scope under which to store this result object.
 void setScroller(Scroller scroller)
           
 void setSingleForm(boolean singleForm)
          Set the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aggregate

protected boolean aggregate
Field to store the aggregate state [false].


scroller

protected Scroller scroller
Our scroller object for paging through lists.

Constructor Detail

ProcessResultBase

public ProcessResultBase()
Default constructor.


ProcessResultBase

public ProcessResultBase(Object data)
Convenience constructor to set result object.

Parameters:
data - The default data object

ProcessResultBase

public ProcessResultBase(Object data,
                         boolean singleForm)
Convenience constructor to set result object and singleForm status.

Parameters:
data - The default data object

ProcessResultBase

public ProcessResultBase(String dispatch)
Convenience constructor to set forwarding advice.

Parameters:
dispatch - The default dispatch advice
Method Detail

getName

public String getName()
Description copied from interface: ProcessResult
Return the attribute name for the result object.

Typically, this will be set by the caller but is provided in case a special name must be used or a way is needed to distingish between result objects.

Specified by:
getName in interface ProcessResult
Returns:
the name

setName

public void setName(String name)
Set the attribute name for this result object.

Specified by:
setName in interface ProcessResult
Parameters:
name - The new name

getScope

public String getScope()
Return the scope under which to store this result object.

Specified by:
getScope in interface ProcessResult
Returns:
the scope

setScope

public void setScope(String scope)
Set the scope under which to store this result object.

Specified by:
setScope in interface ProcessResult
Parameters:
scope - The new scope

isSingleForm

public boolean isSingleForm()
Return the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.

Specified by:
isSingleForm in interface ProcessResult
Returns:
True if this is a single record

setSingleForm

public void setSingleForm(boolean singleForm)
Set the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.

Specified by:
setSingleForm in interface ProcessResult
Parameters:
Set - to true for single form.

isExposed

public boolean isExposed()
Return the exposed state.

Specified by:
isExposed in interface ProcessResult
Returns:
True if the result should be exposed

setExposed

public void setExposed(boolean exposed)
Indicates whether the result should be exposed to the rest of the application through a context.

Specified by:
setExposed in interface ProcessResult
Parameters:
multiple - The new exposed

getData

public Object getData()
Return the data object.

Specified by:
getData in interface ProcessResult
Returns:
The data object

setData

public void setData(Object data)
Assign a new data object.

Specified by:
setData in interface ProcessResult
Parameters:
data - The new data object

isData

public boolean isData()
Return whether data object has been set.

Specified by:
isData in interface ProcessResult
Returns:
True if this result contains a data object

isAggregate

public boolean isAggregate()
Return whether the result of this ProcessResult is a collection of contains other ProcessResult objects to be handled individually. This allows processes to be combined on the business tier and returned to controller as a single operation.

Specified by:
isAggregate in interface ProcessResult
Returns:
True if this ProcessResult contains other ProcessResults objects

setAggregate

public void setAggregate(boolean aggregate)
Assign a new container state.

Specified by:
setAggregate in interface ProcessResult
Parameters:
aggregate - Set to true for aggregate result

isMessages

public boolean isMessages()
Return whether there are any messages queued.

Specified by:
isMessages in interface ProcessResult
Returns:
True if there are messages queued.

addMessage

public boolean addMessage(Object message)
Add a message to the list. Instantiate messages if it does not already exist.

Specified by:
addMessage in interface ProcessResult
Returns:
True if message added.

getMessages

public List getMessages()
Return the messages list (an ArrayList).

Specified by:
getMessages in interface ProcessResult
Returns:
The message list

setMessages

public void setMessages(List messages)
Set a new list of messages.

Parameters:
The - new list of messages

getDispatch

public String getDispatch()
The dispatch property can be used to re-route control to an non-default location, either as a system path or via a logical name (e.g ActionForward).

Specified by:
getDispatch in interface ProcessResult
Returns:
The dispatch advice
See Also:
setDispatchPath()

setDispatch

public void setDispatch(String dispatch)
Set the dispatch advice.

Specified by:
setDispatch in interface ProcessResult
Parameters:
dispatch - The new dispatch advice.

isDispatch

public boolean isDispatch()
Return whether dispatch advice has been set.

Specified by:
isDispatch in interface ProcessResult
Returns:
True if dispatch advice has been set.

isDispatchPath

public boolean isDispatchPath()
Return whether dispatch advice is suppose to be a path or a token (e.g. ActionForward name)

Specified by:
isDispatchPath in interface ProcessResult
Returns:
True if dispatch advice is a URI

setDispatchPath

public void setDispatchPath(boolean dispatchPath)
Set the dispatchPath state.

Specified by:
setDispatchPath in interface ProcessResult
Parameters:
Boolean - Set to true if dispatch is a URI

setScroller

public void setScroller(Scroller scroller)

getScroller

public Scroller getScroller()


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.