Java Doc for CLIPParser.java in  » Portal » Open-Portal » com » sun » portal » rewriter » util » clip » 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 » Portal » Open Portal » com.sun.portal.rewriter.util.clip 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.portal.rewriter.util.clip.CLIPParser

CLIPParser
public class CLIPParser (Code)



Constructor Summary
public  CLIPParser(CLIPSubCommand[] aSubCommands, String aToolHelpMessage)
     Creates a CLIP parser instance with a set of sub commands.
public  CLIPParser(CLIPOption[] options, int minOperands, int maxOperands, String aCommandHelpMessage, String operandsHelp)
     Creates a CLIP parser instance with no sub commands.

Method Summary
public  StringgetHelp(String[] args)
     Returns the Help for the command.

Using the current arguments determines if a full help or a sub command help should be returned.


Parameters:
  args - the current argument array, to determine the type of help to return.

public static  StringgetName(String element)
     Returns the name part of a name/value pair element.

It uses '=' as the name/value separator.


Parameters:
  element - the option or operand name/value pair element.

public  String[]getOperands(String[] args)
     Returns a String array with all the operands of the argument array.

All the operands after the options end or after the operand demarcator "--".


Parameters:
  args - argument array to parse for operands.

public  MapgetOptions(String[] args)
     Returns a Map with all the (key,value) for all the options.

The key is the option long name.

The value is always a String array, it's length is always one except if it's a collection option, then the length is the number of collection values in the option.

If the option is a boolean option (not option value or it a negated option "--no-


Parameters:
  args - argument array to parse for options.

public  StringgetSubCommand(String[] args)
     Returns the sub command from the argument array.
Parameters:
  args - argument array to parse for sub command.
public  StringgetToolHelp()
    
public static  StringgetValue(String element)
     Returns the value part of a name/value pair element.

It uses '=' as the name/value separator.


Parameters:
  element - the option or operand name/value pair element.

public  booleanneedsHelp(String[] args)
     Returns if the command invocation needs help or not.

It may be an exlicit request for help, using the --help option, or because an invalid argument set has been given.


Parameters:
  args - the array argument.

static  StringscanForStdExitOptions(String[] args)
    
public  StringtoString(String[] args)
     String representation of the processed command arguments.
public  StringtoString()
    
public  voidverifyArguments(String[] args)
     Verifies the argument array is valid for the CLIP parser definition.
static  voidverifyName(String name, String exceptionMsgPrefix)
     Verifies a name (sub command or long option name ) is well formed.


Constructor Detail
CLIPParser
public CLIPParser(CLIPSubCommand[] aSubCommands, String aToolHelpMessage) throws IllegalArgumentException(Code)
Creates a CLIP parser instance with a set of sub commands.
Parameters:
  aSubCommands - array of sub commands for the CLIPParser.
Parameters:
  aToolHelpMessage - message for the command.
throws:
  IllegalArgumentException - if invalid information is passed.



CLIPParser
public CLIPParser(CLIPOption[] options, int minOperands, int maxOperands, String aCommandHelpMessage, String operandsHelp) throws IllegalArgumentException(Code)
Creates a CLIP parser instance with no sub commands.
Parameters:
  options - array with all the valid options for the sub command,or NULL if the sub command expects no options.
Parameters:
  minOperands - minimum number of operands the sub command expects.
Parameters:
  maxOperands - maximum number of operands the sub command expects.
Parameters:
  aCommandHelpMessage - help message for the command.
Parameters:
  operandsHelp - help message for the operands.
throws:
  IllegalArgumentException - if invalid information is passed.




Method Detail
getHelp
public String getHelp(String[] args)(Code)
Returns the Help for the command.

Using the current arguments determines if a full help or a sub command help should be returned.


Parameters:
  args - the current argument array, to determine the type of help to return. the help for the command.




getName
public static String getName(String element)(Code)
Returns the name part of a name/value pair element.

It uses '=' as the name/value separator.


Parameters:
  element - the option or operand name/value pair element. the name portion of the name/value pair or the completeelement if there is no value.




getOperands
public String[] getOperands(String[] args) throws CLIPException(Code)
Returns a String array with all the operands of the argument array.

All the operands after the options end or after the operand demarcator "--".


Parameters:
  args - argument array to parse for operands. all the operands from the argument array, if the argument array has no operands it returns an empty array.
throws:
  CLIPException - thrown if the operands can not be process because errors in the options or if the numberof operands in the argument array is outside of the minimum and maximum operand boundaries.




getOptions
public Map getOptions(String[] args) throws CLIPException(Code)
Returns a Map with all the (key,value) for all the options.

The key is the option long name.

The value is always a String array, it's length is always one except if it's a collection option, then the length is the number of collection values in the option.

If the option is a boolean option (not option value or it a negated option "--no-


Parameters:
  args - argument array to parse for options. a Map instance with all the options of the argument array.
throws:
  CLIPException - thrown if there are invalid or incorrect optionsin the argument array or if mandatory options are missing from theargument array.




getSubCommand
public String getSubCommand(String[] args) throws CLIPException(Code)
Returns the sub command from the argument array.
Parameters:
  args - argument array to parse for sub command. the entered sub command or NULL if no sub command was found.
throws:
  CLIPException - thrown if the sub command is invalid.



getToolHelp
public String getToolHelp()(Code)



getValue
public static String getValue(String element)(Code)
Returns the value part of a name/value pair element.

It uses '=' as the name/value separator.


Parameters:
  element - the option or operand name/value pair element. the value portion of the name/value pair or nullif there is not value in the element.




needsHelp
public boolean needsHelp(String[] args)(Code)
Returns if the command invocation needs help or not.

It may be an exlicit request for help, using the --help option, or because an invalid argument set has been given.


Parameters:
  args - the array argument. true if help is needed, false otherwise.




scanForStdExitOptions
static String scanForStdExitOptions(String[] args)(Code)



toString
public String toString(String[] args) throws CLIPException(Code)
String representation of the processed command arguments.


Parameters:
  args - argument array String representation.
throws:
  CLIPException - thrown if the argument array could not be processed successfuly.




toString
public String toString()(Code)



verifyArguments
public void verifyArguments(String[] args)(Code)
Verifies the argument array is valid for the CLIP parser definition.
Parameters:
  args - argument array to verify.processed successfuly.



verifyName
static void verifyName(String name, String exceptionMsgPrefix)(Code)
Verifies a name (sub command or long option name ) is well formed.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.