Source Code Cross Referenced for AddressWithProgrammaticValidations.java in  » Development » JValidate » nl » knowlogy » validation » test » 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 » JValidate » nl.knowlogy.validation.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package nl.knowlogy.validation.test;
002:
003:        import nl.knowlogy.validation.ClassValidator;
004:        import nl.knowlogy.validation.ClassValidatorImpl;
005:        import nl.knowlogy.validation.Messages;
006:        import nl.knowlogy.validation.Validatable;
007:        import nl.knowlogy.validation.validators.AllowedValuesValidator;
008:        import nl.knowlogy.validation.validators.IsNotBlankValidator;
009:        import nl.knowlogy.validation.validators.IsRequiredValidator;
010:        import nl.knowlogy.validation.validators.MaxLengthValidator;
011:        import nl.knowlogy.validation.validators.PatternValidator;
012:
013:        public class AddressWithProgrammaticValidations implements  Validatable {
014:
015:            public static ClassValidator validator = new AddressWithProgrammaticValidationsValidator();
016:
017:            // optional register it with the validationengine with a static method here
018:            // static{
019:            // nl.knowlogy.validation.ValidationEngine.registerValidator(validator);
020:            // }
021:
022:            public static class AddressWithProgrammaticValidationsValidator
023:                    extends ClassValidatorImpl {
024:
025:                public AddressWithProgrammaticValidationsValidator() {
026:                    super (AddressWithProgrammaticValidations.class);
027:                    add(new IsRequiredValidator("city"));
028:                    add(new MaxLengthValidator("city", new Long(10)));
029:                    add(new IsNotBlankValidator("city"));
030:                    add(new IsRequiredValidator("countryCode"));
031:                    add(new IsRequiredValidator("houseNumber"));
032:                    add(new MaxLengthValidator("houseNumber", new Long(5)));
033:                    add(new IsNotBlankValidator("houseNumber"));
034:                    add(new IsNotBlankValidator("houseNumberExtension"));
035:                    add(new IsRequiredValidator("street"));
036:                    add(new MaxLengthValidator("street", new Long(30)));
037:                    add(new IsNotBlankValidator("street"));
038:                    add(new IsRequiredValidator("zipCode", "zipcode.isrequired"));
039:                    add(new PatternValidator("zipCode",
040:                            "^[1-9]\\d{3}[- ]?[a-zA-Z]{2}$",
041:                            "zipcode.invalidformat"));
042:                    add(new MaxLengthValidator("zipCode", new Long(6),
043:                            "zipcode.tolong"));
044:                    add(new IsRequiredValidator("typeAdres"));
045:                    add(new AllowedValuesValidator("typeAdres", "C,V",
046:                            "typeadress.notallowedvalue"));
047:                }
048:            }
049:
050:            private String street;
051:
052:            private Integer houseNumber;
053:
054:            private String houseNumberExtension;
055:
056:            private String zipCode;
057:
058:            private String city;
059:
060:            private String countryCode;
061:
062:            private String typeAdres;
063:
064:            /**
065:             * @return Returns the city.
066:             */
067:            public String getCity() {
068:                return city;
069:            }
070:
071:            /**
072:             * 
073:             * @param city
074:             *            The city to set.
075:             */
076:            public void setCity(String city) {
077:                this .city = city;
078:            }
079:
080:            /**
081:             * @return Returns the countryCode.
082:             */
083:            public String getCountryCode() {
084:                return countryCode;
085:            }
086:
087:            /**
088:             * @param countryCode
089:             *            The countryCode to set.
090:             */
091:            public void setCountryCode(String countryCode) {
092:                this .countryCode = countryCode;
093:            }
094:
095:            /**
096:             * 
097:             * 
098:             * @return Returns the houseNumber.
099:             */
100:            public Integer getHouseNumber() {
101:                return houseNumber;
102:            }
103:
104:            /**
105:             * 
106:             * @param houseNumber
107:             *            The houseNumber to set.
108:             */
109:            public void setHouseNumber(Integer houseNumber) {
110:                this .houseNumber = houseNumber;
111:            }
112:
113:            /**
114:             * @return Returns the houseNumberExtension.
115:             */
116:            public String getHouseNumberExtension() {
117:                return houseNumberExtension;
118:            }
119:
120:            /**
121:             * @param houseNumberExtension
122:             *            The houseNumberExtension to set.
123:             */
124:            public void setHouseNumberExtension(String houseNumberExtension) {
125:                this .houseNumberExtension = houseNumberExtension;
126:            }
127:
128:            /**
129:             * @return Returns the street.
130:             */
131:            public String getStreet() {
132:                return street;
133:            }
134:
135:            /**
136:             * 
137:             * @param street
138:             *            The street to set.
139:             */
140:            public void setStreet(String street) {
141:                this .street = street;
142:            }
143:
144:            /**
145:             * @return Returns the zipCode.
146:             */
147:            public String getZipCode() {
148:                return zipCode;
149:            }
150:
151:            /**
152:             * 
153:             * @param zipCode
154:             *            The zipCode to set.
155:             */
156:            public void setZipCode(String zipCode) {
157:                this .zipCode = zipCode;
158:            }
159:
160:            /**
161:             * @return Returns the typeAdres.
162:             */
163:            public String getTypeAdres() {
164:                return typeAdres;
165:            }
166:
167:            /**
168:             * 
169:             * @param typeAdres
170:             *            The typeAdres to set.
171:             */
172:            public void setTypeAdres(String typeAdres) {
173:                this .typeAdres = typeAdres;
174:            }
175:
176:            public void validate(Messages messages) {
177:                validator.validate(this, messages);
178:            }
179:
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.