Source Code Cross Referenced for VDLx2VDLt.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » toolkit » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.vdl.toolkit 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:        package org.griphyn.vdl.toolkit;
016:
017:        import java.io.*;
018:        import org.griphyn.common.util.Version;
019:        import org.griphyn.common.util.Currently;
020:        import org.griphyn.vdl.classes.*;
021:        import org.griphyn.vdl.parser.*;
022:        import org.griphyn.vdl.classes.Definitions;
023:        import org.griphyn.vdl.util.Logging;
024:        import org.griphyn.vdl.directive.VDLxConvert;
025:        import org.xml.sax.InputSource;
026:        import gnu.getopt.*;
027:
028:        /**
029:         * This class uses the <code>VDLxParser</code> to parse VDL XML 
030:         * specification and output VDL textual specification. 
031:         *
032:         * @author Jens-S. Vöckler
033:         * @author Yong Zhao
034:         * @version $Revision: 50 $
035:         *
036:         * @see org.griphyn.vdl.parser.VDLxParser
037:         */
038:        public class VDLx2VDLt extends Toolkit {
039:            VDLx2VDLt(String appName) {
040:                super (appName);
041:            }
042:
043:            public void showUsage() {
044:                String linefeed = System.getProperty("line.separator", "\r\n");
045:                System.out
046:                        .println("$Id: VDLx2VDLt.java 50 2007-05-19 00:48:32Z gmehta $"
047:                                + linefeed
048:                                + "VDS version "
049:                                + Version.instance().toString() + linefeed);
050:
051:                System.out.println("Usage: " + this .m_application
052:                        + " [-v] VDLxFile VDLtFile" + linefeed + "   or: "
053:                        + this .m_application + " [-v] VDLxFile > VDLtFile"
054:                        + linefeed + "   or: " + this .m_application
055:                        + " [-v] < VDLxFile > VDLtFile" + linefeed + "   or: "
056:                        + this .m_application + " -V");
057:
058:                System.out
059:                        .println(linefeed
060:                                + "Generic options: "
061:                                + linefeed
062:                                + " -V|--version     print version information and exit."
063:                                + linefeed
064:                                + " -v|--verbose     verbose mode, print parser details on stdout."
065:                                + linefeed);
066:            }
067:
068:            /**
069:             * Creates a set of long options.
070:             */
071:            protected LongOpt[] generateValidOptions() {
072:                LongOpt[] lo = new LongOpt[3];
073:
074:                lo[0] = new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V');
075:                lo[1] = new LongOpt("verbose", LongOpt.NO_ARGUMENT, null, 'v');
076:                lo[2] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
077:
078:                return lo;
079:            }
080:
081:            /**
082:             * the works
083:             */
084:            public static void main(String[] args) {
085:                try {
086:                    VDLx2VDLt me = new VDLx2VDLt("vdlx2vdlt");
087:
088:                    // obtain commandline options first -- we may need the database stuff
089:                    Getopt opts = new Getopt(me.m_application, args, "hvV", me
090:                            .generateValidOptions());
091:                    opts.setOpterr(false);
092:                    int option = 0;
093:                    while ((option = opts.getopt()) != -1) {
094:                        switch (option) {
095:                        case 'V':
096:                            System.out
097:                                    .println("$Id: VDLx2VDLt.java 50 2007-05-19 00:48:32Z gmehta $");
098:                            System.out.println("VDS version "
099:                                    + Version.instance().toString());
100:                            return;
101:
102:                        case 'v':
103:                            option = me.increaseVerbosity();
104:                            if (option == 1)
105:                                me.m_logger.register("parser", System.out,
106:                                        option);
107:                            else
108:                                me.m_logger.setLevel("parser", option);
109:                            break;
110:
111:                        case '?':
112:                            System.out.println("Invalid option '"
113:                                    + (char) opts.getOptopt() + "'");
114:                        default:
115:                        case 'h':
116:                            me.showUsage();
117:                            return;
118:                        }
119:                    }
120:
121:                    // work
122:                    Writer wr = null;
123:                    Reader rd = null;
124:                    int where = opts.getOptind();
125:                    switch (args.length - where) {
126:                    case 2:
127:                        wr = new BufferedWriter(new FileWriter(args[where + 1]));
128:                        rd = new BufferedReader(new FileReader(args[where + 0]));
129:                        break;
130:                    case 1:
131:                        wr = new OutputStreamWriter(System.out);
132:                        rd = new BufferedReader(new FileReader(args[where]));
133:                        break;
134:                    case 0:
135:                        System.err.println("# reminder: reading from stdin");
136:                        wr = new OutputStreamWriter(System.out);
137:                        rd = new InputStreamReader(System.in);
138:                        break;
139:                    default:
140:                        me.showUsage();
141:                        throw new RuntimeException(
142:                                "Illegal number of non-option arguments");
143:                    }
144:
145:                    VDLxConvert convert = new VDLxConvert();
146:                    convert.VDLx2VDLt(rd, wr);
147:                    rd.close();
148:                    wr.flush();
149:                    wr.close();
150:
151:                } catch (RuntimeException rte) {
152:                    System.err.println("Runtime error: " + rte.getMessage());
153:                    System.exit(1);
154:                } catch (Exception e) {
155:                    System.err.println("Stumbled over " + e.getMessage());
156:                    e.printStackTrace(System.err);
157:                    System.exit(1);
158:                }
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.