Java Doc for State.java in  » J2EE » Expresso » com » jcorporate » expresso » core » controller » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Expresso » com.jcorporate.expresso.core.controller 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.core.controller.State

All known Subclasses:   com.jcorporate.expresso.services.controller.dbmaint.DynamicCmd,  com.jcorporate.expresso.services.controller.configuration.ConfigurationBase,
State
public class State implements Cloneable,Serializable(Code)
A State embodies a single state in the finite state machine of a Controller object. Transitioning to a new state causes a Controller to generate a set of Input, Output and Action objects. In order to transition to a new state a controller can require that certain parameters be supplied

A state is not inherantly threadsafe. The framework clones the state and hands it off to the multithreaded controller with each state invocation.



Field Summary
final public static  StringNOTEMPTY_MASK
     Regular expression to check for at least one character, including newline (?s) puts the expressoion in single-line mode so that .
protected  booleansecure
    

Constructor Summary
public  State()
     The no-args constructor is not normally used directly, but only by the mechanism that runs the states in order to invoke a state dynamically.
public  State(String newName, String newDescrip)
     Convenience constructor to allow us to specify a new state with a name and description.

Method Summary
protected  voidadd(ControllerElement t)
    
protected  voidaddAutoInput(String fieldName, String friendlyName, String defaultValue, int displayLength, int maxLength, Vector validValues)
     addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.
protected  voidaddAutoInput(String fieldName, String dbClassName, String defaultValue)
     addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.
protected  voidaddAutoInput(String fieldName, String friendlyName, String dbClassName, String defaultValue)
     addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.
protected  voidaddBlock(Block newBlock)
     Adds a block to the controller response associated with this state.
public  voidaddError(String newError)
    
protected  voidaddInput(Input newInput)
    
public  voidaddOptionalParameter(String newParam)
    
protected  voidaddOutput(Output newOutput)
    
public  voidaddParameter(String newParam, String mask)
    
public  voidaddParameter(String newParam, boolean required, String mask)
    
public  voidaddParameter(String newParam, boolean required, String mask, String maskError)
    
public  voidaddRequiredParameter(String newParam)
    
public  voidaddTransition(Transition newTransition)
     Adds a transition to the controller response associated with a state.
protected  voidautoValidate(String checkClassName, ErrorCollection errorCollection)
     AutoValidate is a quick way to validate the fields of a specified dbobj.
protected  voidautoValidate(String checkClassName, ErrorCollection errorCollection, Vector requiredFields)
     AutoValidate is a quick way to validate the fields of a specified dbobj.
protected  voidcalculateHandlerName(String stateName)
     Calculates the appropriate method name based upon the name of the state to be used in setName.
protected  voidcheckMask(String paramName, String paramValue, Pattern compiledRegExp)
     Checks a parameter given to the controller against a defined regular expression mask.
public  voidcheckParamMasks()
     If any parameters for this state have an associated regular expression "mask", verify that the value for the parameter matches the mask.
protected  voidclearFormCache()
    
public  Objectclone()
    
public  booleanequals(Object o)
     Overrides default Object.equals(Object) behavior
Parameters:
  o - The object to compare against.
protected  StringgetAttribute(String attrib)
    
public  ControllergetController()
    
protected  ControllerRequestgetControllerRequest()
     Gets the ControllerRequest object associated with this state.
protected  ControllerResponsegetControllerResponse()
    
protected  DBControllergetDBController()
     A convenience method that allows you to get a secured controller which is a subclass of a regular controller.
public  StringgetDBName()
    
public  StringgetDataContext()
    
public  StringgetDescription()
     Get the description of this state, as supplied when the state is created.
public  StringgetErrorState()
    
public  TransitiongetErrorTransition()
     Return the error transition.
public  ErrorCollectiongetErrors()
     Returns the errors collection of this current request and current state.
protected  StringgetFileName(String paramName)
     If a particular parameter represents an uploaded file (which can be determined by the isFileParameter(String) method) then this method retrieves the server-side file name - e.g.
protected  StringgetFormCache(String fieldName)
    
public  StringgetHandlerName()
     Return the name of the method that will handle transitions to this state.
public  StringgetInitParameter(String paramName)
    
public  StringgetName()
     Get the name of this state.
public  ObjectgetObjectParameter(String paramName)
    
public  VectorgetOptionalParameters()
    
public  ListgetOptionalParametersList()
     Returns a list of optional parameters.
public  StringgetParameter(String paramCode)
     Fetch the value for the given parameter.
public  VectorgetParameters()
    
protected  PatternMatchergetPatternMatcher()
     Retrieve a thread local instance of the Perl5 pattern matcher.
public  ListgetRequiredParametersList()
    
public  ControllerResponsegetResponse()
    
public  TransitiongetReturnToSender()
     Return the return-to-sender transition.
public  PersistentSessiongetSession()
    
public  StringgetStateFormClass()
     Return the class name (if any) of the state form associated with this state.
protected  StringgetString(String key, Object[] args)
     Convenience method - simply passes the request for a string on to the ControllerResponse object associated with this State
Parameters:
  key - The key to format
Parameters:
  args - The formatting arguments for the key.
protected  StringgetString(String key)
    
public  TransitiongetSuccessTransition()
     Return the success transition.
protected  intgetUid()
     Retrieve the State user ID.
public  StringgetUser()
    
public  inthashCode()
     Returns a hash code value for the object.
public  booleanisFileParameter(String paramName)
     Does a specified parameter refer to an uploaded file?
Parameters:
  paramName - The parameter name to check.
protected  booleanisParameter(String paramName)
    
public  booleanisSecure()
    
public  voidperform(StateForm stateForm, ControllerRequest newRequest, ControllerResponse newResponse)
     A state may implement a "perform" method to actually perform it's logic by overriding this method.
public  voidrun(ControllerRequest newRequest, ControllerResponse newResponse)
     A state may implement a "run" method to actually perform it's logic by overriding this method.
protected  voidsaveErrors(ErrorCollection e)
    
public  voidsetController(Controller newController)
    
public  voidsetDescription(String newDescrip)
     Set a description (human-readable) for this state.
public synchronized  voidsetErrorState(String newErrorState)
     Sets the state that defines the error state.
public  voidsetErrorTransition(Transition newErrorTransition)
     Set the error transition.
protected  voidsetFormCache()
    
public  voidsetHandlerName(String newName)
    
public synchronized  voidsetMask(String paramName, String mask)
     Set a regular expression "mask" for a particular parameter The parameter value is checked against this mask before the transition into the new state begins Also precompiles the regular expression to allow for quick parameter checking.
public synchronized  voidsetMask(String paramName, String mask, String errorMsg)
    
public  voidsetMaskError(String paramName, String errorMsg)
     If a state fails a parameter check on a mask, then the error specified will be stored in the error collections
Parameters:
  paramName - The parameter name to check against the regular expressionset in setMask
Parameters:
  errorMsg - The error message to display.
public  voidsetName(String newName)
     Set the internal "name" of this state.
protected  voidsetResponse(ControllerResponse res)
    
public  voidsetReturnToSender(Transition newReturnToSender)
     Set the return-to-sender transition.
public  voidsetSecure(boolean newSecure)
     Sets the "should be secure" flag.
public  voidsetStateFormClass(String newStateFormClass)
     Set the class name of the state form associated with this state.
public  voidsetSuccessTransition(Transition newSuccessTransition)
     Set the success transition.
public  StringtoString()
     Returns the string of this state.
protected  voidtransition(String newState, ControllerRequest req, ControllerResponse res)
    

Field Detail
NOTEMPTY_MASK
final public static String NOTEMPTY_MASK(Code)
Regular expression to check for at least one character, including newline (?s) puts the expressoion in single-line mode so that . (a period) will match newlines



secure
protected boolean secure(Code)
Is this state to run within an SSL setting?




Constructor Detail
State
public State()(Code)
The no-args constructor is not normally used directly, but only by the mechanism that runs the states in order to invoke a state dynamically. Use the detailed constructor instead.



State
public State(String newName, String newDescrip)(Code)
Convenience constructor to allow us to specify a new state with a name and description. This is the preferred constructor for a controller, and is used within the constructor of a Controller to define the states that this controller has available to it.
Parameters:
  newName - The name of the new state
Parameters:
  newDescrip - A description for the new state - this may be(preferrably) a key into the local language file in order to facilitateinternationalization, or just a simple string.




Method Detail
add
protected void add(ControllerElement t) throws ControllerException(Code)
Convenience method to allow us to add any ControllerElement to this controllers inputs, outputs or transitions
Parameters:
  t - The controller element, either an input an output, a transition,or a block that gets added to the controller response.
throws:
  ControllerException - upon error



addAutoInput
protected void addAutoInput(String fieldName, String friendlyName, String defaultValue, int displayLength, int maxLength, Vector validValues) throws ControllerException(Code)
addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.

Creation date: (7/20/00 3:43:14 PM) author: Adam Rossi, PlatinumSolutions
Parameters:
  fieldName - java.lang.String
Parameters:
  friendlyName - the input's label
Parameters:
  defaultValue - java.lang.String
Parameters:
  displayLength - The size of the input text box
Parameters:
  maxLength - The maximum input length of the input.
Parameters:
  validValues - The valid value list associated with the input(for drop-down multivalue inputs only)
throws:
  ControllerException - upon error




addAutoInput
protected void addAutoInput(String fieldName, String dbClassName, String defaultValue) throws ControllerException(Code)
addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.

Creation date: (7/20/00 3:43:14 PM)

author: Adam Rossi, PlatinumSolutions
Parameters:
  fieldName - java.lang.String
Parameters:
  dbClassName - java.lang.String
Parameters:
  defaultValue - java.lang.String
throws:
  ControllerException - upon error




addAutoInput
protected void addAutoInput(String fieldName, String friendlyName, String dbClassName, String defaultValue) throws ControllerException(Code)
addAutoInput is a convenience method that creates a new Input object based on the specified field parameters and adds the input object to this controller object.

Creation date: (7/20/00 3:43:14 PM) author: Adam Rossi, PlatinumSolutions
Parameters:
  fieldName - java.lang.String
Parameters:
  friendlyName - The label of the new input
Parameters:
  dbClassName - java.lang.String
Parameters:
  defaultValue - java.lang.String
throws:
  ControllerException - upon error




addBlock
protected void addBlock(Block newBlock) throws ControllerException(Code)
Adds a block to the controller response associated with this state.
Parameters:
  newBlock - The block to add.
throws:
  ControllerException - upon error



addError
public void addError(String newError) throws ControllerException(Code)
Adds an error to this controllerResponse's Error Collection
Parameters:
  newError - The error string to add.
throws:
  ControllerException - upon error



addInput
protected void addInput(Input newInput) throws ControllerException(Code)
Adds an input object to the controller response
Parameters:
  newInput - The input object to add
throws:
  ControllerException - upon error



addOptionalParameter
public void addOptionalParameter(String newParam)(Code)
Add a required parameter to this state
Parameters:
  newParam - The name of the new parameter



addOutput
protected void addOutput(Output newOutput) throws ControllerException(Code)
Adds an output object to the controller response
Parameters:
  newOutput - The output object to add
throws:
  ControllerException - upon error



addParameter
public void addParameter(String newParam, String mask)(Code)
Add a new parameter to this state
Parameters:
  newParam - The name of the new parameter
Parameters:
  mask - The regular expression mask to compare against.



addParameter
public void addParameter(String newParam, boolean required, String mask)(Code)
Add a new parameter to this state
Parameters:
  newParam - The name of the new parameter
Parameters:
  required - should an exception be thrown if this parameter isn't included?
Parameters:
  mask - The regular expression mask to compare against.



addParameter
public void addParameter(String newParam, boolean required, String mask, String maskError)(Code)
Add a new parameter to this state
Parameters:
  newParam - The name of the new parameter
Parameters:
  required - should an exception be thrown if this parameter isn't included?
Parameters:
  mask - The regular expression mask to compare against.
Parameters:
  maskError - The error message to give if mask validation fails.



addRequiredParameter
public void addRequiredParameter(String newParam)(Code)
Add a required parameter to this state
Parameters:
  newParam - The name of the new parameter



addTransition
public void addTransition(Transition newTransition) throws ControllerException(Code)
Adds a transition to the controller response associated with a state.
Parameters:
  newTransition - The transition to add.
throws:
  ControllerException - upon error



autoValidate
protected void autoValidate(String checkClassName, ErrorCollection errorCollection) throws ValidationException, ControllerException(Code)
AutoValidate is a quick way to validate the fields of a specified dbobj.

Creation date: (7/19/00 6:06:21 PM) author: Adam Rossi, PlatinumSolutions
Parameters:
  checkClassName - The class name to perform the error checking
Parameters:
  errorCollection - The error collection to get populated with validation errorsif validation on any particular field fails.
throws:
  com.jcorporate.expresso.core.controller.ValidationException - The exception description.
throws:
  ControllerException - upon error




autoValidate
protected void autoValidate(String checkClassName, ErrorCollection errorCollection, Vector requiredFields) throws ValidationException, ControllerException(Code)
AutoValidate is a quick way to validate the fields of a specified dbobj. This method has not been tested and may not be correct. This methods takes an optional requiredFields vector, which just tells the validation routine which inputs are required.

Creation date: (7/19/00 6:06:21 PM) author: Adam Rossi, PlatinumSolutions
Parameters:
  checkClassName - The class name to perform the error checking
Parameters:
  errorCollection - The error collection to get populated with validation errorsif validation on any particular field fails.
Parameters:
  requiredFields - Vector of Strings: which inputs are required.
throws:
  com.jcorporate.expresso.core.controller.ValidationException - Upon validation error
throws:
  ControllerException - upon error




calculateHandlerName
protected void calculateHandlerName(String stateName)(Code)
Calculates the appropriate method name based upon the name of the state to be used in setName. and sets the handlerName String to that value.
Parameters:
  stateName - The name of the state to calculate the handler name.



checkMask
protected void checkMask(String paramName, String paramValue, Pattern compiledRegExp) throws ControllerException(Code)
Checks a parameter given to the controller against a defined regular expression mask. Puts an error in the error collection if there is a problem.
Parameters:
  paramName - The state parameter name to check
Parameters:
  paramValue - The value given the state to check against
Parameters:
  compiledRegExp - The compiled Perl 5 regular expression.
throws:
  ControllerException - if there's an error with the regular expressionmask.



checkParamMasks
public void checkParamMasks() throws ControllerException(Code)
If any parameters for this state have an associated regular expression "mask", verify that the value for the parameter matches the mask.
throws:
  ControllerException - upon error



clearFormCache
protected void clearFormCache() throws ControllerException(Code)
Clears the form cache in the controller response
throws:
  ControllerException - upon error



clone
public Object clone() throws java.lang.CloneNotSupportedException(Code)
returns a copy of itself a State instance
throws:
  java.lang.CloneNotSupportedException - as specified by the object API



equals
public boolean equals(Object o)(Code)
Overrides default Object.equals(Object) behavior
Parameters:
  o - The object to compare against. true if the objects are equal



getAttribute
protected String getAttribute(String attrib)(Code)
get attribute from request
Parameters:
  attrib - The name of an "attribute" for this ControllerElement item java.lang.String The attribute value



getController
public Controller getController() throws ControllerException(Code)
retrieve the controller instance that is associated with this state A controller instance.
throws:
  ControllerException - [usually never thrown]



getControllerRequest
protected ControllerRequest getControllerRequest()(Code)
Gets the ControllerRequest object associated with this state. the ControllerRequest Object associated with this state.



getControllerResponse
protected ControllerResponse getControllerResponse()(Code)
Retrieves the ControllerResponse object associated with this state ControllerResponse object associated with this state.



getDBController
protected DBController getDBController() throws ControllerException(Code)
A convenience method that allows you to get a secured controller which is a subclass of a regular controller. DBController instance
throws:
  ControllerException - if the controller is not an instance ofDBController.



getDBName
public String getDBName()(Code)
Return the name of the database connection we use - or null for the default connection java.lang.String



getDataContext
public String getDataContext()(Code)
Return the name of the database connection we use - or null for the default connection java.lang.String



getDescription
public String getDescription()(Code)
Get the description of this state, as supplied when the state is created. Try to use the description as a key in the current local-language file - if available. If we can't do that, or it's not a valid key, just return the description as it was originally specified. A description of this state



getErrorState
public String getErrorState()(Code)
Retrieves the state that has been set as the error state java.lang.String



getErrorTransition
public Transition getErrorTransition()(Code)
Return the error transition. This is the transition that will be executed if this state returns any errors in the error collection. The Error Transition



getErrors
public ErrorCollection getErrors() throws ControllerException(Code)
Returns the errors collection of this current request and current state. The ControllerResponse error collection
throws:
  ControllerException - upon error



getFileName
protected String getFileName(String paramName)(Code)
If a particular parameter represents an uploaded file (which can be determined by the isFileParameter(String) method) then this method retrieves the server-side file name - e.g. the location that has the data that was uploaded stored in it.
Parameters:
  paramName - The parameter name that is expected to have a file associated with. java.lang.String the location on the filesystem of the temporary storedfile.



getFormCache
protected String getFormCache(String fieldName) throws ControllerException(Code)
Retrieve the form cash value
Parameters:
  fieldName - The name of the field to retrieve The field's value, may be null.
throws:
  ControllerException - upon error



getHandlerName
public String getHandlerName()(Code)
Return the name of the method that will handle transitions to this state. the handler name, or possibly null if the



getInitParameter
public String getInitParameter(String paramName)(Code)
?
Parameters:
  paramName - The parameter name to retrieve java.lang.String



getName
public String getName()(Code)
Get the name of this state. This is the "internal" name used to refer to the state, not the "human readable" description. This name is suitable as a parameter to the newState method, for example. The name of this state



getObjectParameter
public Object getObjectParameter(String paramName) throws ControllerException(Code)
?
Parameters:
  paramName - The parameter name to retrieve java.lang.Object
throws:
  ControllerException - upon conversion error



getOptionalParameters
public Vector getOptionalParameters()(Code)
Returns a list of optional parameters a vector of optional parameter names.



getOptionalParametersList
public List getOptionalParametersList()(Code)
Returns a list of optional parameters. Same as getOptionalParameters() but returns an List instead a List collection giving all optional parameters



getParameter
public String getParameter(String paramCode) throws ControllerException(Code)
Fetch the value for the given parameter. Return null if there is no such parameter
Parameters:
  paramCode - Code of the parameter desired java.lang.String The parameter value.
throws:
  ControllerException - upon error



getParameters
public Vector getParameters()(Code)
Return the list of parameters required by this State A Vector of the parameter names required by this State



getPatternMatcher
protected PatternMatcher getPatternMatcher()(Code)
Retrieve a thread local instance of the Perl5 pattern matcher. Allows for optimization of # of instances of pattern matcher vs synchronization. PatternMatcher



getRequiredParametersList
public List getRequiredParametersList()(Code)
Same as getParameters, but returns a List instead a List collection giving all optional paramaters



getResponse
public ControllerResponse getResponse()(Code)



getReturnToSender
public Transition getReturnToSender()(Code)
Return the return-to-sender transition. This is the transition that will serialized and passed to any state that is invoked via a transition that has return-to-sender enabled. Transition object



getSession
public PersistentSession getSession() throws ControllerException(Code)



getStateFormClass
public String getStateFormClass()(Code)
Return the class name (if any) of the state form associated with this state. java.lang.String



getString
protected String getString(String key, Object[] args) throws ControllerException(Code)
Convenience method - simply passes the request for a string on to the ControllerResponse object associated with this State
Parameters:
  key - The key to format
Parameters:
  args - The formatting arguments for the key. The i18n message that key points to.
throws:
  ControllerException - upon error



getString
protected String getString(String key) throws ControllerException(Code)
Convenience method - simply passes the request for a string on to the ControllerResponse object associated with this State
Parameters:
  key - the message bundle key java.lang.String
throws:
  ControllerException - upon error



getSuccessTransition
public Transition getSuccessTransition()(Code)
Return the success transition. This is the transition that will be executed if this state returns without errors in the error collection. Transition object



getUid
protected int getUid() throws ControllerException(Code)
Retrieve the State user ID. integer user ID
throws:
  ControllerException - upon error



getUser
public String getUser()(Code)
Get the user name java.lang.String login name of the user



hashCode
public int hashCode()(Code)
Returns a hash code value for the object. a hash code value for this object.



isFileParameter
public boolean isFileParameter(String paramName)(Code)
Does a specified parameter refer to an uploaded file?
Parameters:
  paramName - The parameter name to check. true if the parameter is a file parameter.



isParameter
protected boolean isParameter(String paramName) throws ControllerException(Code)



isSecure
public boolean isSecure()(Code)
Should this state be run within an SSL protocol (if SSL is available) true if SSL should be used for this state



perform
public void perform(StateForm stateForm, ControllerRequest newRequest, ControllerResponse newResponse) throws NonHandleableException, ControllerException(Code)
A state may implement a "perform" method to actually perform it's logic by overriding this method. Any associated state form will be passed in with its data populated. If this method is not implemented by a child class then the "run" method will be called to be backwards compatible with previous versions.
Parameters:
  stateForm - unused, useful for matching with Struts API
Parameters:
  newRequest - The controller request object that has been prepared by the framework,that contains all the parameters needed to execute state
Parameters:
  newResponse - The controller response object that you use to populate withinputs, outputs and transitions.
throws:
  ControllerException - upon error
throws:
  NonHandleableException - upon fatal error



run
public void run(ControllerRequest newRequest, ControllerResponse newResponse) throws ControllerException, NonHandleableException(Code)
A state may implement a "run" method to actually perform it's logic by overriding this method.
Parameters:
  newRequest - The controller request object that has been prepared by the framework,that contains all the parameters needed to execute state
Parameters:
  newResponse - The controller response object that you use to populate withinputs, outputs and transitions.
throws:
  ControllerException - upon error
throws:
  NonHandleableException - upon fatal error



saveErrors
protected void saveErrors(ErrorCollection e) throws ControllerException(Code)
Saves the errors to the controller response
Parameters:
  e - The error collection to save
throws:
  ControllerException - upon error



setController
public void setController(Controller newController) throws ControllerException(Code)
Set the 'parent' controller
Parameters:
  newController - The controller instance to set for the state
throws:
  ControllerException - upon error or null parameter



setDescription
public void setDescription(String newDescrip)(Code)
Set a description (human-readable) for this state. This is normally done via the constructor. The description may be just a string describing the state in a few words, or (preferrably) it may be a key into the local language file, facilitation internationalization
Parameters:
  newDescrip - The new description for the state.



setErrorState
public synchronized void setErrorState(String newErrorState)(Code)
Sets the state that defines the error state.
Parameters:
  newErrorState - The name of the state to set as the error state



setErrorTransition
public void setErrorTransition(Transition newErrorTransition)(Code)
Set the error transition. This is the transition that will be executed if this state returns any errors in the error collection.
Parameters:
  newErrorTransition - A new transition object pointing to the error state



setFormCache
protected void setFormCache() throws ControllerException(Code)
To the form cache in the controller response
throws:
  ControllerException - upon error



setHandlerName
public void setHandlerName(String newName)(Code)
Use this function to bypass the automatic function naming that goes on based upon the state
Parameters:
  newName - the name that you want the controller to automatically call whentransitioning to this state.



setMask
public synchronized void setMask(String paramName, String mask)(Code)
Set a regular expression "mask" for a particular parameter The parameter value is checked against this mask before the transition into the new state begins Also precompiles the regular expression to allow for quick parameter checking.
Parameters:
  paramName - parameter name to check against the regular expression
Parameters:
  mask - The regular Expression
throws:
  IllegalArgumentException - if the paramName or mask is blank.



setMask
public synchronized void setMask(String paramName, String mask, String errorMsg)(Code)
Set a regular expression "mask" for a particular parameter The parameter value is checked against this mask before the transition into the new state begins
Parameters:
  paramName - The parameter name to check against the regular expression
Parameters:
  mask - The regular Expression
Parameters:
  errorMsg - The error message to use if the state fails.
throws:
  IllegalArgumentException - if the paramName or mask is blank.



setMaskError
public void setMaskError(String paramName, String errorMsg)(Code)
If a state fails a parameter check on a mask, then the error specified will be stored in the error collections
Parameters:
  paramName - The parameter name to check against the regular expressionset in setMask
Parameters:
  errorMsg - The error message to display. It may be a string thatexists in a resource bundle, in which case that will be displayed instead



setName
public void setName(String newName)(Code)
Set the internal "name" of this state. Normally done via the constructor when the state is "declared" in the appropriate controller.
Parameters:
  newName - The new name of the state.



setResponse
protected void setResponse(ControllerResponse res) throws ControllerException(Code)
Set the ControllerResponse object associated with this state
Parameters:
  res - The controller response associated with the state's instance.
throws:
  ControllerException - upon invalid parameter



setReturnToSender
public void setReturnToSender(Transition newReturnToSender)(Code)
Set the return-to-sender transition. This is the transition that will be serialized and passed to any state that is invoked via a transition that has return-to-sender enabled.
Parameters:
  newReturnToSender - Transition instance.



setSecure
public void setSecure(boolean newSecure)(Code)
Sets the "should be secure" flag. Ie, if SSL is available, this state should be run within SSL.
Parameters:
  newSecure - Such a true if you want to use SSL for the state.



setStateFormClass
public void setStateFormClass(String newStateFormClass)(Code)
Set the class name of the state form associated with this state.
Parameters:
  newStateFormClass - The class name of the object to use as an action form.



setSuccessTransition
public void setSuccessTransition(Transition newSuccessTransition)(Code)
Set the success transition. This is the transition that will be executed if this state returns without errors in the error collection.
Parameters:
  newSuccessTransition - The transition to use for successful state executions.



toString
public String toString()(Code)
Returns the string of this state. Good for debugging error messages The object class name



transition
protected void transition(String newState, ControllerRequest req, ControllerResponse res) throws ControllerException, NonHandleableException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.