Source Code Cross Referenced for ValidationFailure.java in  » Development » iScreen » org » iscreen » 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 » Development » iScreen » org.iscreen 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-2007 Dan Shellman
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.iscreen;
017:
018:        import java.util.ArrayList;
019:        import java.util.Collection;
020:
021:        /**
022:         * A validation failure represents a single failure reported by a Validator
023:         * (Validators can report multiple failures, each represented by a separate
024:         * instance of this class).  Each failure has a message (usually designed
025:         * to be accessible to the end user), a label (usually used to associate
026:         * the failure with an UI component, though a label is not required), and
027:         * the Collection of fields (these are really the OGNL expressions used to 'get'
028:         * properties from the JavaBean being validated) from the JavaBean that was
029:         * originally validated (normally, there's just one field). <br />
030:         * <br />
031:         * Interface code (such as a web framework) can use instances of this
032:         * class to display the validation failures.  There should be sufficient
033:         * information associated with each failure to apply the message to
034:         * the correct location within the interface.
035:         *
036:         * @author Shellman, Dan
037:         */
038:        public class ValidationFailure {
039:            protected String label;
040:            protected String name;
041:            protected String message;
042:            protected Collection fields = new ArrayList();
043:            protected Integer index;
044:
045:            /**
046:             * Default constructor.
047:             */
048:            public ValidationFailure() {
049:            } //end ValidationFailure()
050:
051:            public void setLabel(String theLabel) {
052:                label = theLabel;
053:            } //end setLabel()
054:
055:            /**
056:             * Retrieves the label associated with this failure.
057:             *
058:             * @return Returns the label associated with this failure.
059:             */
060:            public String getLabel() {
061:                return label;
062:            } //end getLabel()
063:
064:            /**
065:             * Sets the name for this failure message.  The name is used to identify the
066:             * failure message and relate it to a particular validator (the one that
067:             * reported the failure).
068:             *
069:             * @param   theName The name of the validator causing this failure.
070:             */
071:            public void setName(String theName) {
072:                name = theName;
073:            } //end setName()
074:
075:            /**
076:             * Retrieves the name of the validator reporting the failure message.
077:             *
078:             * @return Returns the name of the validator.
079:             */
080:            public String getName() {
081:                return name;
082:            } //end getName()
083:
084:            /**
085:             * Retrieves the failure message (which has already been evaluated
086:             * and localized.
087:             *
088:             * @return Returns the failure message.
089:             */
090:            public String getMessage() {
091:                return message;
092:            } //end getMessage()
093:
094:            public void setMessage(String theMessage) {
095:                message = theMessage;
096:            } //end setMessage()
097:
098:            /**
099:             * Retrieves the fields (the OGNL expression used to 'get' the properties
100:             * from the JavaBean being validated) of the JavaBean being validated.
101:             *
102:             * @return Returns the fields of the JavaBean being validated.
103:             */
104:            public Collection getFields() {
105:                return fields;
106:            } //end getFields()
107:
108:            public void setFields(Collection theFields) {
109:                fields.clear();
110:                fields.addAll(theFields);
111:            } //end setFields()
112:
113:            /**
114:             * Retrieves the index of the JavaBean/Object being validated that was
115:             * an element within an array/Collection of a 'parent' JavaBean being
116:             * validated (i.e. an object was being validated, and it had a property
117:             * that was an array/Collection that was 'forwarded' on to another
118:             * validation set and iterated over.  The subsequent members of that
119:             * array/Collection would have an index of which was being validated
120:             * at a particular time.  This is that index.).  If no indexed property
121:             * was being validated, then this will return null.  Note that a null
122:             * value is different than a zero value, as a zero value represents the
123:             * first element in an array/Collection, where a null value implies that
124:             * the JavaBean/Object wasn't involved in an array/Collection in the
125:             * first place.
126:             *
127:             * @return Returns the index of the JavaBean/Object that was being validated.
128:             */
129:            public Integer getIndex() {
130:                return index;
131:            } //end getIndex()
132:
133:            public void setIndex(Integer theIndex) {
134:                index = theIndex;
135:            } //end setIndex()
136:        } //end ValidationFailure
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.