org.apache.commons.scaffold.util
Class BizResponseImpl

java.lang.Object
  extended by org.apache.commons.scaffold.util.BizResponseImpl
All Implemented Interfaces:
Serializable, BizResponse

public class BizResponseImpl
extends Object
implements Serializable, BizResponse

Concrete implementation of a business response [org,apache.commons.util.BizResponse] 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
See Also:
Serialized Form

Field Summary
protected  boolean aggregate
          Field to store the aggregate state [false].
protected  Scroller scroller
          Our scroller object for paging through lists.
 
Constructor Summary
BizResponseImpl()
          Default constructor.
BizResponseImpl(Object data)
          Convenience constructor to set result object.
BizResponseImpl(Object data, boolean singleForm)
          Convenience constructor to set result object and singleForm status.
BizResponseImpl(String dispatch)
          Convenience constructor to set forwarding advice.
 
Method Summary
 void addMessage(Message message)
          Add a message to the list.
 void addMessage(Message message, String property)
          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).
 Messages getMessages()
          Return the messages list.
 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 true path or a logical name (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)
          Field to store dispatch property.
 void setDispatchPath(boolean dispatchPath)
          Indicates whether dispatch advice (if any) is suppose to be a path or a logical name (e.g.
 void setExposed(boolean exposed)
          Indicates whether the result should be exposed to the rest of the application through a context.
 void setMessages(Messages 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

BizResponseImpl

public BizResponseImpl()
Default constructor.


BizResponseImpl

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

Parameters:
data - The default data object

BizResponseImpl

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

Parameters:
data - The default data object

BizResponseImpl

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

Parameters:
dispatch - The default dispatch advice
Method Detail

getName

public String getName()
Description copied from interface: BizResponse
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 BizResponse
Returns:
the name

setName

public void setName(String name)
Description copied from interface: BizResponse
Set the attribute name for this result object.

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

getScope

public String getScope()
Description copied from interface: BizResponse
Return the scope under which to store this result object.

Specified by:
getScope in interface BizResponse
Returns:
the scope

setScope

public void setScope(String scope)
Description copied from interface: BizResponse
Set the scope under which to store this result object.

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

isSingleForm

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

Specified by:
isSingleForm in interface BizResponse

setSingleForm

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

Specified by:
setSingleForm in interface BizResponse

isExposed

public boolean isExposed()
Description copied from interface: BizResponse
Return the exposed state.

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

setExposed

public void setExposed(boolean exposed)
Description copied from interface: BizResponse
Indicates whether the result should be exposed to the rest of the application through a context.

Specified by:
setExposed in interface BizResponse

getData

public Object getData()
Description copied from interface: BizResponse
Return the data object.

Specified by:
getData in interface BizResponse

setData

public void setData(Object data)
Description copied from interface: BizResponse
Assign a new data object.

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

isData

public boolean isData()
Description copied from interface: BizResponse
Return whether data object has been set.

Specified by:
isData in interface BizResponse

isAggregate

public boolean isAggregate()
Description copied from interface: BizResponse
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 BizResponse

setAggregate

public void setAggregate(boolean aggregate)
Description copied from interface: BizResponse
Assign a new container state.

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

isMessages

public boolean isMessages()
Description copied from interface: BizResponse
Return whether there are any messages queued.

Specified by:
isMessages in interface BizResponse

addMessage

public void addMessage(Message message,
                       String property)
Description copied from interface: BizResponse
Add a message to the list. Instantiate messages if it does not already exist.

Specified by:
addMessage in interface BizResponse

addMessage

public void addMessage(Message message)
Description copied from interface: BizResponse
Add a message to the list. Instantiate messages if it does not already exist.

Specified by:
addMessage in interface BizResponse

getMessages

public Messages getMessages()
Description copied from interface: BizResponse
Return the messages list.

Specified by:
getMessages in interface BizResponse

setMessages

public void setMessages(Messages messages)

getDispatch

public String getDispatch()
Description copied from interface: BizResponse
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 BizResponse
See Also:
setDispatchPath()

setDispatch

public void setDispatch(String dispatch)
Description copied from interface: BizResponse
Field to store dispatch property.

Specified by:
setDispatch in interface BizResponse

isDispatch

public boolean isDispatch()
Description copied from interface: BizResponse
Return whether dispatch advice has been set.

Specified by:
isDispatch in interface BizResponse

isDispatchPath

public boolean isDispatchPath()
Description copied from interface: BizResponse
Return whether dispatch advice is suppose to be a true path or a logical name (e.g. ActionForward)

Specified by:
isDispatchPath in interface BizResponse

setDispatchPath

public void setDispatchPath(boolean dispatchPath)
Description copied from interface: BizResponse
Indicates whether dispatch advice (if any) is suppose to be a path or a logical name (e.g. ActionForward).

Specified by:
setDispatchPath in interface BizResponse
Parameters:
dispatchPath - The new dispatch advice

setScroller

public void setScroller(Scroller scroller)

getScroller

public Scroller getScroller()


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