Source Code Cross Referenced for BindException.java in  » J2EE » spring-framework-2.0.6 » org » springframework » 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 » J2EE » spring framework 2.0.6 » org.springframework.validation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2006 the original author or authors.
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:
017:        package org.springframework.validation;
018:
019:        import java.util.List;
020:        import java.util.Map;
021:
022:        import org.springframework.beans.PropertyEditorRegistry;
023:        import org.springframework.util.Assert;
024:
025:        /**
026:         * Thrown when binding errors are considered fatal. Implements the
027:         * BindingResult interface (and thus its super-interface Errors)
028:         * to allow for the direct analysis of binding errors.
029:         *
030:         * <p>As of Spring 2.0, this is a special-purpose class. Normally, application
031:         * code will work with the BindingResult interface, or a DataBinder that
032:         * in turn exposes a BindingResult via
033:         * {@link org.springframework.validation.DataBinder#getBindingResult()}.
034:         *
035:         * @author Rod Johnson
036:         * @author Juergen Hoeller
037:         * @author Rob Harrop
038:         * @see BindingResult
039:         * @see DataBinder#getBindingResult()
040:         * @see DataBinder#close()
041:         */
042:        public class BindException extends Exception implements  BindingResult {
043:
044:            /**
045:             * Prefix for the name of the BindException instance in a model,
046:             * followed by the object name.
047:             * @deprecated in favor of <code>BindingResult.MODEL_KEY_PREFIX</code>
048:             * @see BindingResult#MODEL_KEY_PREFIX
049:             */
050:            public static final String ERROR_KEY_PREFIX = BindException.class
051:                    .getName()
052:                    + ".";
053:
054:            private final BindingResult bindingResult;
055:
056:            /**
057:             * Create a new BindException instance for a BindingResult.
058:             * @param bindingResult the BindingResult instance to wrap
059:             */
060:            public BindException(BindingResult bindingResult) {
061:                Assert.notNull(bindingResult, "BindingResult must not be null");
062:                this .bindingResult = bindingResult;
063:            }
064:
065:            /**
066:             * Create a new BindException instance for a target bean.
067:             * @param target target bean to bind onto
068:             * @param objectName the name of the target object
069:             * @see BeanPropertyBindingResult
070:             */
071:            public BindException(Object target, String objectName) {
072:                Assert.notNull(target, "Target object must not be null");
073:                this .bindingResult = new BeanPropertyBindingResult(target,
074:                        objectName);
075:            }
076:
077:            /**
078:             * Return the BindingResult that this BindException wraps.
079:             * Will typically be a BeanPropertyBindingResult.
080:             * @see BeanPropertyBindingResult
081:             */
082:            public final BindingResult getBindingResult() {
083:                return this .bindingResult;
084:            }
085:
086:            /**
087:             * Return the PropertyEditorRegistry that the underlying BindingResult uses.
088:             * @see #getBindingResult()
089:             */
090:            public final PropertyEditorRegistry getPropertyEditorRegistry() {
091:                return this .bindingResult.getPropertyEditorRegistry();
092:            }
093:
094:            public String getObjectName() {
095:                return this .bindingResult.getObjectName();
096:            }
097:
098:            public void setNestedPath(String nestedPath) {
099:                this .bindingResult.setNestedPath(nestedPath);
100:            }
101:
102:            public String getNestedPath() {
103:                return this .bindingResult.getNestedPath();
104:            }
105:
106:            public void pushNestedPath(String subPath) {
107:                this .bindingResult.pushNestedPath(subPath);
108:            }
109:
110:            public void popNestedPath() throws IllegalStateException {
111:                this .bindingResult.popNestedPath();
112:            }
113:
114:            public void reject(String errorCode) {
115:                this .bindingResult.reject(errorCode);
116:            }
117:
118:            public void reject(String errorCode, String defaultMessage) {
119:                this .bindingResult.reject(errorCode, defaultMessage);
120:            }
121:
122:            public void reject(String errorCode, Object[] errorArgs,
123:                    String defaultMessage) {
124:                this .bindingResult.reject(errorCode, errorArgs, defaultMessage);
125:            }
126:
127:            public void rejectValue(String field, String errorCode) {
128:                this .bindingResult.rejectValue(field, errorCode);
129:            }
130:
131:            public void rejectValue(String field, String errorCode,
132:                    String defaultMessage) {
133:                this .bindingResult
134:                        .rejectValue(field, errorCode, defaultMessage);
135:            }
136:
137:            public void rejectValue(String field, String errorCode,
138:                    Object[] errorArgs, String defaultMessage) {
139:                this .bindingResult.rejectValue(field, errorCode, errorArgs,
140:                        defaultMessage);
141:            }
142:
143:            public void addAllErrors(Errors errors) {
144:                this .bindingResult.addAllErrors(errors);
145:            }
146:
147:            public boolean hasErrors() {
148:                return this .bindingResult.hasErrors();
149:            }
150:
151:            public int getErrorCount() {
152:                return this .bindingResult.getErrorCount();
153:            }
154:
155:            public List getAllErrors() {
156:                return this .bindingResult.getAllErrors();
157:            }
158:
159:            public boolean hasGlobalErrors() {
160:                return this .bindingResult.hasGlobalErrors();
161:            }
162:
163:            public int getGlobalErrorCount() {
164:                return this .bindingResult.getGlobalErrorCount();
165:            }
166:
167:            public List getGlobalErrors() {
168:                return this .bindingResult.getGlobalErrors();
169:            }
170:
171:            public ObjectError getGlobalError() {
172:                return this .bindingResult.getGlobalError();
173:            }
174:
175:            public boolean hasFieldErrors() {
176:                return this .bindingResult.hasFieldErrors();
177:            }
178:
179:            public int getFieldErrorCount() {
180:                return this .bindingResult.getFieldErrorCount();
181:            }
182:
183:            public List getFieldErrors() {
184:                return this .bindingResult.getFieldErrors();
185:            }
186:
187:            public FieldError getFieldError() {
188:                return this .bindingResult.getFieldError();
189:            }
190:
191:            public boolean hasFieldErrors(String field) {
192:                return this .bindingResult.hasFieldErrors(field);
193:            }
194:
195:            public int getFieldErrorCount(String field) {
196:                return this .bindingResult.getFieldErrorCount(field);
197:            }
198:
199:            public List getFieldErrors(String field) {
200:                return this .bindingResult.getFieldErrors(field);
201:            }
202:
203:            public FieldError getFieldError(String field) {
204:                return this .bindingResult.getFieldError(field);
205:            }
206:
207:            public Object getFieldValue(String field) {
208:                return this .bindingResult.getFieldValue(field);
209:            }
210:
211:            public Class getFieldType(String field) {
212:                return this .bindingResult.getFieldType(field);
213:            }
214:
215:            public Object getTarget() {
216:                return this .bindingResult.getTarget();
217:            }
218:
219:            public Map getModel() {
220:                return this .bindingResult.getModel();
221:            }
222:
223:            public void recordSuppressedField(String fieldName) {
224:                this .bindingResult.recordSuppressedField(fieldName);
225:            }
226:
227:            public String[] getSuppressedFields() {
228:                return this .bindingResult.getSuppressedFields();
229:            }
230:
231:            public void addError(ObjectError error) {
232:                this .bindingResult.addError(error);
233:            }
234:
235:            public String[] resolveMessageCodes(String errorCode, String field) {
236:                return this .bindingResult.resolveMessageCodes(errorCode, field);
237:            }
238:
239:            /**
240:             * Returns diagnostic information about the errors held in this object.
241:             */
242:            public String getMessage() {
243:                return this .bindingResult.toString();
244:            }
245:
246:            public boolean equals(Object other) {
247:                return (this  == other || this .bindingResult.equals(other));
248:            }
249:
250:            public int hashCode() {
251:                return this.bindingResult.hashCode();
252:            }
253:
254:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.