Java Doc for XValidationHandler.java in  » XML-UI » XUI » net » xoetrope » xui » validation » 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 » XML UI » XUI » net.xoetrope.xui.validation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.xoetrope.xui.validation.XValidationHandler

XValidationHandler
public class XValidationHandler implements XValidationExceptionHandler(Code)

Provides a means of managing validations. This class is intended as a mixin class for the panel classes such as XPage. Validations are integrated with the event handler so that when the event with which the validation is associated is triggered the validation is invoked. Failure of a validation results in subsequent event handler methods being blocked.

Validations are also invoked at page transition and all validations rules are checked. If all validations are not passed then the page transition can be blocked.

If a validation failes then an exception is thrown. The exception is by default handled by this class but it can be redirected to a custom exception handler with the setExceptionHandler method. This interface allows exceptions to handled in a variety of different ways.

Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt $Revision: 1.6 $



Field Summary
protected  Containercontainer
    
protected  XEventHandlereventHandler
    
protected  XValidationExceptionHandlerexceptionHandler
    
protected  XValidationFactoryvalidationFactory
    
protected  Hashtablevalidations
    

Constructor Summary
public  XValidationHandler(Container c)
     Create a new validation handler for the specified container.

Method Summary
public  intaccumulateMessages(boolean accumulate, int level)
     informs the handler when a page validation is starting or stopping.
public  XValidatoraddValidation(Component comp, String validationName, String method, int mask)
     Adds a validation to this page.
public  XValidatoraddValidation(Component comp, String validationName, String method)
     Adds a validation to this page.
public  XValidatoraddValidation(Component comp, String validationName)
     Adds a validation to this page.
public  intcheckValidations()
     Check all validations for this page.
public  voidclearValidations()
    
public  XValidatorgetValidation(String validationName, String method, int mask)
     Adds a validation to this page.
public  XValidatorgetValidation(String validationName, String method)
     Gets a XValidator object.
public  VectorgetValidations(Component comp)
    
public  booleanhandleException(Component comp, Exception ex, XValidator validator)
     A method called when a validation exeption has been trapped.
Parameters:
  c - Component being validated
Parameters:
  ex - The exception caused
Parameters:
  validator - The validator being used to validate.
public  voidsetEventHandler(XEventHandler eh)
     Set the event handler instance.
public  voidsetExceptionHandler(XValidationExceptionHandler eh)
    
public  voidsetValidationFactory(XValidationFactory vf)
    
public  intvalidationHandler()
     Invoke the validators for the last event.

Field Detail
container
protected Container container(Code)



eventHandler
protected XEventHandler eventHandler(Code)



exceptionHandler
protected XValidationExceptionHandler exceptionHandler(Code)



validationFactory
protected XValidationFactory validationFactory(Code)



validations
protected Hashtable validations(Code)




Constructor Detail
XValidationHandler
public XValidationHandler(Container c)(Code)
Create a new validation handler for the specified container. The container provides the context in which the validation operate. Therefore validation methods are found by reflection in the specified container. Normally the container is the current XPage or a derived class.
Parameters:
  c - the container




Method Detail
accumulateMessages
public int accumulateMessages(boolean accumulate, int level)(Code)
informs the handler when a page validation is starting or stopping. Typically when it starts the page will begin to accumulate messages which are to be displayed. When the parameter is false the page will usually display the accumulated messages
Parameters:
  start - boolean to indicate whether the accumulation is started or stopped.



addValidation
public XValidator addValidation(Component comp, String validationName, String method, int mask)(Code)
Adds a validation to this page.
Parameters:
  comp - the component being validated
Parameters:
  validationName - the name of the validation in the validation file
Parameters:
  method - the method used to get the component's value if any
Parameters:
  mask - the event mask used to filter the events that trigger the validation the new and initialized XValidator



addValidation
public XValidator addValidation(Component comp, String validationName, String method)(Code)
Adds a validation to this page. It is assumed that the validation will be invoked in response to FocusEvent.FOCUS_LOST events
Parameters:
  comp - the component being validated
Parameters:
  validationName - the name of the validation in the validation file
Parameters:
  method - the method used to get the component's value if any the new and initialized XValidator



addValidation
public XValidator addValidation(Component comp, String validationName)(Code)
Adds a validation to this page. It is assumed that the validation will be invoked in response to FocusEvent.FOCUS_LOST events
Parameters:
  comp - the component being validated
Parameters:
  validationName - the name of the validation in the validation file the new and initialized XValidator



checkValidations
public int checkValidations()(Code)
Check all validations for this page. Typically this method should be invoked prior to a page transition or a critical transaction. the maximum error level raised by the validators



clearValidations
public void clearValidations()(Code)
Reset/removes all validations



getValidation
public XValidator getValidation(String validationName, String method, int mask)(Code)
Adds a validation to this page.
Parameters:
  comp - the component being validated
Parameters:
  validationName - the name of the validation in the validation file
Parameters:
  mask - the event mask used to filter the events that trigger the validation the new and initialized XValidator



getValidation
public XValidator getValidation(String validationName, String method)(Code)
Gets a XValidator object. The parameters of the object are read from the validation file
Parameters:
  validationName - the name of the validation in the validation file
Parameters:
  method - the method used to get the component's value if any the new and initialized XValidator



getValidations
public Vector getValidations(Component comp)(Code)
Gets all the validations installed for a component
Parameters:
  comp - the target component a Vector of XValidators



handleException
public boolean handleException(Component comp, Exception ex, XValidator validator)(Code)
A method called when a validation exeption has been trapped.
Parameters:
  c - Component being validated
Parameters:
  ex - The exception caused
Parameters:
  validator - The validator being used to validate. true to continue with error validation or false to suppress furthervalidation.



setEventHandler
public void setEventHandler(XEventHandler eh)(Code)
Set the event handler instance. This class needs to interact with the event handler to manage focus and to gain access to the current event
Parameters:
  eh - the event handler



setExceptionHandler
public void setExceptionHandler(XValidationExceptionHandler eh)(Code)
Set the validation exception handler called when a validation exception is trapped
Parameters:
  eh -



setValidationFactory
public void setValidationFactory(XValidationFactory vf)(Code)
Sets the factory used to create XValidator objects
Parameters:
  vf -



validationHandler
public int validationHandler()(Code)
Invoke the validators for the last event. Multiple validations are checked in the order in which they were added. the maximum level returned by the validators



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.