Source Code Cross Referenced for CommandLineUtils.java in  » Database-JDBC-Connection-Pool » c3p0 » com » mchange » v2 » cmdline » 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 » Database JDBC Connection Pool » c3p0 » com.mchange.v2.cmdline 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Distributed as part of debuggen v.0.1.0
03:         *
04:         * Copyright (C) 2005 Machinery For Change, Inc.
05:         *
06:         * Author: Steve Waldman <swaldman@mchange.com>
07:         *
08:         * This library is free software; you can redistribute it and/or modify
09:         * it under the terms of the GNU Lesser General Public License version 2.1, as 
10:         * published by the Free Software Foundation.
11:         *
12:         * This software is distributed in the hope that it will be useful,
13:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
14:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15:         * GNU Lesser General Public License for more details.
16:         *
17:         * You should have received a copy of the GNU Lesser General Public License
18:         * along with this software; see the file LICENSE.  If not, write to the
19:         * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20:         * Boston, MA 02111-1307, USA.
21:         */
22:
23:        package com.mchange.v2.cmdline;
24:
25:        public final class CommandLineUtils {
26:            /**
27:             * "Parses" a command line by making use several conventions:
28:             * <UL>
29:             * <LI> Certain arguments are considered "switches", by virtue
30:             *      of being prefixed with some string, usually "-", "/", or "--"
31:             * <LI> Switches may have arguments associated with them. This implementation
32:             *      permits only a single argument per switch
33:             * <LI> Switch arguments are determined via two conventions:
34:             *      <OL>
35:             *      <LI> If a switch is of the form "--switch=value" (where "--" is
36:             *           set as the switch prefix), value is the switches argument.
37:             *      <LI> If a switch is not of this form (simply "--switch"), then the
38:             *           following item on the command line is considered the switch's
39:             *           argument if and only if
40:             *           <OL>
41:             *           <LI> the argSwitches array contains the switch, and
42:             *           <LI> the next item on the command line is not itself a switch
43:             *           </OL>
44:             *      </OL>
45:             * </UL>
46:             *
47:             * @param argv the entire list of arguments, usually the argument to a main function
48:             * @param switchPrefix the string which separates "switches" from regular command line args.
49:             *        Must be non-null
50:             * @param validSwitches a list of all the switches permissible for this command line.
51:             *        If non-null, an UnexpectedSwitchException will be thrown if a switch not
52:             *        in this list is encountered. Use null to accept any switches.
53:             * @param requiredSwitches a list of all the switches required by this command line.
54:             *        If non-null, an MissingSwitchException will be thrown if a switch
55:             *        in this list is not present. Use null if no switches should be considered required.
56:             * @param argSwitches a list of switches that should have an argument associated with them
57:             *        If non-null, an MissingSwitchArgumentException will be thrown if a switch
58:             *        in this list has no argument is not present. Use null if no switches should 
59:             *        be considered to require arguments. However, this parameter is required if 
60:             *        distinct items on a command line should be considered arguments to preceding
61:             *        items. (For example, "f" must be an argSwitch for "-f myfile.txt" to be parsed
62:             *        as switch and argument, but argSwitches is not required to parse "--file=myfile.txt"
63:             */
64:            public static ParsedCommandLine parse(String[] argv,
65:                    String switchPrefix, String[] validSwitches,
66:                    String[] requiredSwitches, String[] argSwitches)
67:                    throws BadCommandLineException {
68:                return new ParsedCommandLineImpl(argv, switchPrefix,
69:                        validSwitches, requiredSwitches, argSwitches);
70:            }
71:
72:            private CommandLineUtils() {
73:            }
74:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.