net.sourceforge.stripes.examples.quickstart
Class CalculatorActionBean

java.lang.Object
  extended by net.sourceforge.stripes.examples.quickstart.CalculatorActionBean
All Implemented Interfaces:
net.sourceforge.stripes.action.ActionBean

public class CalculatorActionBean
extends Object
implements net.sourceforge.stripes.action.ActionBean

A very simple calculator action.

Author:
Tim Fennell

Constructor Summary
CalculatorActionBean()
           
 
Method Summary
 net.sourceforge.stripes.action.Resolution addition()
          An event handler method that adds number one to number two.
 void avoidDivideByZero(net.sourceforge.stripes.validation.ValidationErrors errors)
          An example of a custom validation that checks that division operations are not dividing by zero.
 net.sourceforge.stripes.action.Resolution division()
          An event handler method that divides number one by number two.
 net.sourceforge.stripes.action.ActionBeanContext getContext()
           
 double getNumberOne()
           
 double getNumberTwo()
           
 double getResult()
           
 void setContext(net.sourceforge.stripes.action.ActionBeanContext context)
           
 void setNumberOne(double numberOne)
           
 void setNumberTwo(double numberTwo)
           
 void setResult(double result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatorActionBean

public CalculatorActionBean()
Method Detail

getContext

public net.sourceforge.stripes.action.ActionBeanContext getContext()
Specified by:
getContext in interface net.sourceforge.stripes.action.ActionBean

setContext

public void setContext(net.sourceforge.stripes.action.ActionBeanContext context)
Specified by:
setContext in interface net.sourceforge.stripes.action.ActionBean

getNumberOne

public double getNumberOne()

setNumberOne

public void setNumberOne(double numberOne)

getNumberTwo

public double getNumberTwo()

setNumberTwo

public void setNumberTwo(double numberTwo)

getResult

public double getResult()

setResult

public void setResult(double result)

addition

@DefaultHandler
public net.sourceforge.stripes.action.Resolution addition()
An event handler method that adds number one to number two.


division

public net.sourceforge.stripes.action.Resolution division()
An event handler method that divides number one by number two.


avoidDivideByZero

@ValidationMethod(on="division")
public void avoidDivideByZero(net.sourceforge.stripes.validation.ValidationErrors errors)
An example of a custom validation that checks that division operations are not dividing by zero.



© Copyright 2005, Stripes Development Team.