Source Code Cross Referenced for VersionInfo.java in  » Report » pentaho-report » org » pentaho » util » 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 » Report » pentaho report » org.pentaho.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.pentaho.util;
002:
003:        /**
004:         * Bean that holds the results of the version information
005:         * @author dkincade
006:         */
007:        public class VersionInfo {
008:            /**
009:             * The product id of the product
010:             */
011:            private String productID;
012:
013:            /**
014:             * The text title of the product
015:             */
016:            private String title;
017:
018:            /**
019:             * The major portion of the version number
020:             */
021:            private String versionMajor;
022:
023:            /**
024:             * The minor portion of the version number
025:             */
026:            private String versionMinor;
027:
028:            /**
029:             * The release portion of the version number
030:             */
031:            private String versionRelease;
032:
033:            /**
034:             * The milestone portion of the version number
035:             */
036:            private String versionMilestone;
037:
038:            /**
039:             * THe build number portion of the version number
040:             */
041:            private String versionBuild;
042:
043:            /**
044:             * Boolean indicating if this was retrieved from the manifest
045:             * (indicating that it is running from a build) or from class files
046:             * (indicating it is running from compiled class files).
047:             */
048:            private boolean fromManifest;
049:
050:            public boolean isFromManifest() {
051:                return fromManifest;
052:            }
053:
054:            public String getProductID() {
055:                return productID;
056:            }
057:
058:            public String getTitle() {
059:                return title;
060:            }
061:
062:            public String getVersionMajor() {
063:                return versionMajor;
064:            }
065:
066:            public String getVersionMinor() {
067:                return versionMinor;
068:            }
069:
070:            public String getVersionRelease() {
071:                return versionRelease;
072:            }
073:
074:            public String getVersionMilestone() {
075:                return versionMilestone;
076:            }
077:
078:            public String getVersionBuild() {
079:                return versionBuild;
080:            }
081:
082:            public String getVersionNumber() {
083:                StringBuffer sb = new StringBuffer();
084:                if (versionMajor != null) {
085:                    sb.append(versionMajor);
086:                    if (versionMinor != null) {
087:                        sb.append('.').append(versionMinor);
088:                        if (versionRelease != null) {
089:                            sb.append('.').append(versionRelease);
090:                            if (versionMilestone != null) {
091:                                sb.append('.').append(versionMilestone);
092:                                if (versionBuild != null) {
093:                                    sb.append('.').append(versionBuild);
094:                                }
095:                            }
096:                        }
097:                    }
098:                }
099:                return sb.toString();
100:            }
101:
102:            public String toString() {
103:                StringBuffer sb = new StringBuffer();
104:                sb
105:                        .append("fromManifest       = [").append(fromManifest).append("]\n"); //$NON-NLS-1$  //$NON-NLS-2$
106:                sb
107:                        .append("productID          = [").append(productID).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
108:                sb.append("title              = [").append(title).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
109:                sb
110:                        .append("versionMajor       = [").append(versionMajor).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
111:                sb
112:                        .append("versionMinor       = [").append(versionMinor).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
113:                sb
114:                        .append("versionRelease     = [").append(versionRelease).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
115:                sb
116:                        .append("versionMilestone   = [").append(versionMilestone).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
117:                sb
118:                        .append("versionBuild       = [").append(versionBuild).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
119:                sb
120:                        .append("getVersionNumber() = [").append(getVersionNumber()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
121:                return sb.toString();
122:            }
123:
124:            void setFromManifest(boolean fromManifest) {
125:                this .fromManifest = fromManifest;
126:            }
127:
128:            void setProductID(String productID) {
129:                this .productID = productID;
130:            }
131:
132:            void setTitle(String title) {
133:                this .title = title;
134:            }
135:
136:            void setVersionMajor(String versionMajor) {
137:                this .versionMajor = versionMajor;
138:            }
139:
140:            void setVersionMinor(String versionMinor) {
141:                this .versionMinor = versionMinor;
142:            }
143:
144:            void setVersionRelease(String versionRelease) {
145:                this .versionRelease = versionRelease;
146:            }
147:
148:            void setVersionMilestone(String versionMilestone) {
149:                this .versionMilestone = versionMilestone;
150:            }
151:
152:            void setVersionBuild(String versionBuild) {
153:                this .versionBuild = versionBuild;
154:            }
155:
156:            /**
157:             * Sets the version fields by passing the whole string and parsing it.
158:             * <br/>
159:             * NOTE: spaces will be changed to dots before parsing
160:             * @param version the version number (1.6.0.GA.500 or 1.6.0-RC2.400)
161:             */
162:            void setVersion(String version) {
163:                // Parse the version
164:                if (version != null) {
165:                    String[] pieces = version.replace('-', '.').split("\\."); //$NON-NLS-1$
166:                    switch (pieces.length) {
167:                    case 9: // just in case
168:                    case 8: // just in case
169:                    case 7: // just in case
170:                    case 6: // just in case
171:                    case 5:
172:                        setVersionBuild(pieces[4]); // intentional fall through
173:                    case 4:
174:                        setVersionMilestone(pieces[3]); // intentional fall through 
175:                    case 3:
176:                        setVersionRelease(pieces[2]); // intentional fall through
177:                    case 2:
178:                        setVersionMinor(pieces[1]); // intentional fall through
179:                    case 1:
180:                        setVersionMajor(pieces[0]); // intentional fall through
181:                    default: // do nothing
182:                    }
183:                }
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.