Source Code Cross Referenced for ApplicationXmlVersion.java in  » Testing » jakarta-cactus » org » apache » cactus » integration » ant » deployment » application » 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 » Testing » jakarta cactus » org.apache.cactus.integration.ant.deployment.application 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * ========================================================================
003:         * 
004:         * Copyright 2003 The Apache Software Foundation.
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         *   http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         * 
018:         * ========================================================================
019:         */
020:        package org.apache.cactus.integration.ant.deployment.application;
021:
022:        import org.w3c.dom.DocumentType;
023:
024:        /**
025:         * Enumerated type that represents the version of the deployment descriptor of
026:         * a enterprise application (application.xml).
027:         * 
028:         * @since Cactus 1.5
029:         * @version $Id: ApplicationXmlVersion.java 239003 2004-05-31 20:05:27Z vmassol $
030:         */
031:        public final class ApplicationXmlVersion implements  Comparable {
032:
033:            // Public Constants --------------------------------------------------------
034:
035:            /**
036:             * Instance for version 1.2.
037:             */
038:            public static final ApplicationXmlVersion V1_2 = new ApplicationXmlVersion(
039:                    "1.2",
040:                    "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN",
041:                    "http://java.sun.com/j2ee/dtds/application_1_2.dtd");
042:
043:            /**
044:             * Instance for version 1.3.
045:             */
046:            public static final ApplicationXmlVersion V1_3 = new ApplicationXmlVersion(
047:                    "1.3",
048:                    "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN",
049:                    "http://java.sun.com/dtd/application_1_3.dtd");
050:
051:            // Instance Variables ------------------------------------------------------
052:
053:            /**
054:             * The version as strnig,
055:             */
056:            private String version;
057:
058:            /**
059:             * The public ID of the corresponding document type.
060:             */
061:            private String publicId;
062:
063:            /**
064:             * The system ID of the corresponding document type.
065:             */
066:            public String systemId;
067:
068:            // Constructors ------------------------------------------------------------
069:
070:            /**
071:             * Constructor.
072:             * 
073:             * @param theVersion The version as string
074:             * @param thePublicId The public ID of the correspondig document type
075:             * @param theSystemId The system ID of the correspondig document type
076:             */
077:            private ApplicationXmlVersion(String theVersion,
078:                    String thePublicId, String theSystemId) {
079:                this .version = theVersion;
080:                this .publicId = thePublicId;
081:                this .systemId = theSystemId;
082:            }
083:
084:            // Public Methods ----------------------------------------------------------
085:
086:            /**
087:             * @see java.lang.Comparable#compareTo
088:             */
089:            public int compareTo(Object theOther) {
090:                if (theOther == this ) {
091:                    return 0;
092:                }
093:                ApplicationXmlVersion otherVersion = (ApplicationXmlVersion) theOther;
094:                if (otherVersion == V1_3) {
095:                    return -1;
096:                }
097:                return 1;
098:            }
099:
100:            /**
101:             * @see java.lang.Object#toString
102:             */
103:            public boolean equals(Object theOther) {
104:                return super .equals(theOther);
105:            }
106:
107:            /**
108:             * @see java.lang.Object#hashCode
109:             */
110:            public int hashCode() {
111:                return super .hashCode();
112:            }
113:
114:            /**
115:             * Returns the tag name.
116:             * 
117:             * @return The tag name
118:             */
119:            public String getVersion() {
120:                return this .version;
121:            }
122:
123:            /**
124:             * Returns the public ID of the document type corresponding to the 
125:             * descriptor version.
126:             * 
127:             * @return The public ID
128:             */
129:            public String getPublicId() {
130:                return publicId;
131:            }
132:
133:            /**
134:             * Returns the system ID of the document type corresponding to the 
135:             * descriptor version.
136:             * 
137:             * @return The system ID
138:             */
139:            public String getSystemId() {
140:                return systemId;
141:            }
142:
143:            /**
144:             * @see java.lang.Object#toString
145:             */
146:            public String toString() {
147:                return getVersion();
148:            }
149:
150:            /**
151:             * Returns the version corresponding to the given document type.
152:             * 
153:             * @param theDocType The document type
154:             * @return The version that matches the document type, or <code>null</code>
155:             *         if the doctype is not recognized
156:             * @throws NullPointerException If the document type is <code>null</code>
157:             */
158:            public static ApplicationXmlVersion valueOf(DocumentType theDocType)
159:                    throws NullPointerException {
160:                return valueOf(theDocType.getPublicId());
161:            }
162:
163:            /**
164:             * Returns the version corresponding to the given public ID.
165:             * 
166:             * @param thePublicId The public ID
167:             * @return The version that matches the public ID, or <code>null</code>
168:             *         if the ID is not recognized
169:             */
170:            public static ApplicationXmlVersion valueOf(String thePublicId) {
171:                if (V1_2.getPublicId().equals(thePublicId)) {
172:                    return ApplicationXmlVersion.V1_2;
173:                } else if (V1_3.getPublicId().equals(thePublicId)) {
174:                    return ApplicationXmlVersion.V1_3;
175:                }
176:                return null;
177:            }
178:
179:        }
w_w___w___._j___a_v_a__2__s_.___c__o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.