Source Code Cross Referenced for ArgumentConfig.java in  » GIS » GeoServer » org » vfny » geoserver » config » 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 » GIS » GeoServer » org.vfny.geoserver.config.validation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Jan 23, 2004
003:         *
004:         * To change the template for this generated file go to
005:         * Window - Preferences - Java - Code Generation - Code and Comments
006:         */
007:        package org.vfny.geoserver.config.validation;
008:
009:        import org.geotools.validation.dto.ArgumentDTO;
010:        import java.beans.Introspector;
011:        import java.beans.PropertyDescriptor;
012:        import java.util.List;
013:        import java.util.Locale;
014:
015:        /**
016:         * ArgumentConfig purpose.
017:         * <p>
018:         * Description of ArgumentConfig ...
019:         * </p>
020:         *
021:         * @author dzwiers, Refractions Research, Inc.
022:         * @author $Author: dmzwiers $ (last modification)
023:         * @version $Id: ArgumentConfig.java 6177 2007-02-19 10:11:27Z aaime $
024:         */
025:        public class ArgumentConfig {
026:            private String name;
027:            private boolean _final;
028:            private Object value;
029:
030:            /**
031:             * ArgumentConfig constructor.
032:             * <p>
033:             * Description
034:             * </p>
035:             *
036:             */
037:            public ArgumentConfig() {
038:            }
039:
040:            public ArgumentConfig(ArgumentConfig dto) {
041:                name = dto.getName();
042:                _final = isFinal();
043:                value = dto.getValue();
044:            }
045:
046:            public ArgumentConfig(ArgumentDTO dto) {
047:                name = dto.getName();
048:                _final = isFinal();
049:                value = dto.getValue();
050:            }
051:
052:            public Object clone() {
053:                return new ArgumentConfig(this );
054:            }
055:
056:            public boolean equals(Object obj) {
057:                boolean r = true;
058:
059:                if ((obj == null) || !(obj instanceof  ArgumentConfig)) {
060:                    return false;
061:                }
062:
063:                ArgumentConfig dto = (ArgumentConfig) obj;
064:                r = r && (dto.isFinal() == _final);
065:
066:                if (name != null) {
067:                    r = r && (name.equals(dto.getName()));
068:                } else if (dto.getName() != null) {
069:                    return false;
070:                }
071:
072:                if (value != null) {
073:                    r = r && (value.equals(dto.getValue()));
074:                } else if (dto.getValue() != null) {
075:                    return false;
076:                }
077:
078:                return r;
079:            }
080:
081:            public int hashCode() {
082:                int r = 1;
083:
084:                if (name != null) {
085:                    r *= name.hashCode();
086:                }
087:
088:                if (value != null) {
089:                    r *= value.hashCode();
090:                }
091:
092:                return r;
093:            }
094:
095:            public ArgumentDTO toDTO() {
096:                ArgumentDTO dto = new ArgumentDTO();
097:                dto.setFinal(_final);
098:                dto.setName(name);
099:                dto.setValue(value);
100:
101:                return dto;
102:            }
103:
104:            /**
105:             * Access _final property.
106:             *
107:             * @return Returns the _final.
108:             */
109:            public boolean isFinal() {
110:                return _final;
111:            }
112:
113:            /**
114:             * Set _final to _final.
115:             *
116:             * @param _final The _final to set.
117:             */
118:            public void setFinal(boolean _final) {
119:                this ._final = _final;
120:            }
121:
122:            /**
123:             * Access name property.
124:             *
125:             * @return Returns the name.
126:             */
127:            public String getName() {
128:                return name;
129:            }
130:
131:            /**
132:             * Set name to name.
133:             *
134:             * @param name The name to set.
135:             */
136:            public void setName(String name) {
137:                this .name = name;
138:            }
139:
140:            /**
141:             * Access value property.
142:             *
143:             * @return Returns the value.
144:             */
145:            public Object getValue() {
146:                return value;
147:            }
148:
149:            /**
150:             * Set value to value.
151:             *
152:             * @param value The value to set.
153:             */
154:            public void setValue(Object value) {
155:                if (value == null) {
156:                    throw new NullPointerException(
157:                            "value should only be set when it has a value");
158:                }
159:
160:                this .value = value;
161:            }
162:
163:            /**
164:             *
165:             * getDisplayName purpose.
166:             * <p>
167:             * This is used to provide the locale to the property descriptor if it is required. This method is thread safe.
168:             * </p>
169:             * <p>
170:             * This method must be both synchornized and static. The global locale is maintained from start to completion of execution, even when an unexpected exception occurs.
171:             * </p>
172:             * @param pd PropertyDescriptor to get the display name from
173:             * @param locale Locale to use if required.
174:             * @return String the Display Name
175:             */
176:            public static synchronized String getDisplayName(
177:                    PropertyDescriptor pd) {
178:                String r = "";
179:
180:                try { // to safely reset the locale.
181:                    r = pd.getDisplayName();
182:                } finally {
183:                }
184:
185:                return r;
186:            }
187:
188:            public static synchronized void loadPropertyLists(
189:                    TestConfig testConfig, Locale lc, List attributeKeys,
190:                    List attributeHelps, List attributeValues) {
191:                if (!lc.equals(Locale.getDefault())) {
192:                    Locale.setDefault(lc);
193:                    Introspector.flushCaches();
194:                }
195:
196:                PropertyDescriptor[] pd = testConfig.getPropertyDescriptors();
197:
198:                for (int i = 0; i < pd.length; i++) {
199:                    PropertyDescriptor property = pd[i];
200:                    String propertyName = property.getName();
201:                    String displayName = ArgumentConfig
202:                            .getDisplayName(property);
203:                    String description = ArgumentConfig
204:                            .getDescription(property);
205:
206:                    attributeKeys.add(propertyName);
207:                    attributeHelps.add(description);
208:                    attributeValues.add(testConfig
209:                            .getArgStringValue(propertyName));
210:                }
211:            }
212:
213:            /**
214:             *
215:             * getDescription purpose.
216:             * <p>
217:             * This is used to provide the locale to the property descriptor if it is required. This method is thread safe.
218:             * </p>
219:             * <p>
220:             * This method must be both synchornized and static.
221:             * </p>
222:             * @param pd PropertyDescriptor to get the display description from
223:             * @param locale Locale to use if required.
224:             * @return String the display description
225:             */
226:            public static synchronized String getDescription(
227:                    PropertyDescriptor pd) {
228:                String r = "";
229:
230:                try { // to safely reset the locale.
231:                    r = pd.getShortDescription();
232:                } finally {
233:                }
234:
235:                return r;
236:            }
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.