Java Doc for ArgumentAcceptingOptionSpec.java in  » Development » JOpt-Simple » joptsimple » 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 » Development » JOpt Simple » joptsimple 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   joptsimple.OptionSpec
      joptsimple.ArgumentAcceptingOptionSpec

All known Subclasses:   joptsimple.OptionalArgumentOptionSpec,  joptsimple.AlternativeLongOptionSpec,  joptsimple.RequiredArgumentOptionSpec,
ArgumentAcceptingOptionSpec
abstract public class ArgumentAcceptingOptionSpec extends OptionSpec (Code)

Specification of an option that accepts an argument.

Instances are returned from OptionSpecBuilder methods to allow the formation of parser directives as sentences in a domain-specific language. For example:

 OptionParser parser = new OptionParser();
 parser.accepts( "c" ).withRequiredArg().ofType( Integer.class );
 

If no methods are invoked on an instance of this class, then that instance's option will treat its argument as a String .


since:
   1.0
author:
   Paul Holser
version:
   $Id: ArgumentAcceptingOptionSpec.java,v 1.31 2007/04/10 20:06:25 pholser Exp $



Constructor Summary
protected  ArgumentAcceptingOptionSpec(String option, boolean argumentRequired)
    
protected  ArgumentAcceptingOptionSpec(String option, boolean argumentRequired, String description)
    

Method Summary
 booleanacceptsArguments()
    
 StringargumentDescription()
    
 ClassargumentType()
    
protected  booleancanConvertArgument(String argument)
     Tells whether the given argument can be successfully converted to the type specified in this spec, if one was given.
final protected  Objectconvert(String argument)
     Converts the given argument to the type specified in this spec, if one was given.
final public  ArgumentAcceptingOptionSpecdescribedAs(String description)
     Specifies a description for the argument of the option that this spec represents.
public  booleanequals(Object that)
    
final  voidhandleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument)
    
abstract protected  voidhandleOptionFurther(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions)
     Provides additional handling of this option when detected.
public  inthashCode()
    
protected  booleanisArgumentOfNumberType()
     Tells whether this option spec converts its arguments to a number type.
public  voidofType(Class argumentType)
    

Specifies a type to which arguments of this spec's option are to be converted.

JOpt Simple accepts types that have either:

  1. a public static method called valueOf which accepts a single argument of type String and whose return type is the same as the class on which the method is declared.
 booleanrequiresArgument()
    
public  StringtoString()
    


Constructor Detail
ArgumentAcceptingOptionSpec
protected ArgumentAcceptingOptionSpec(String option, boolean argumentRequired)(Code)



ArgumentAcceptingOptionSpec
protected ArgumentAcceptingOptionSpec(String option, boolean argumentRequired, String description)(Code)




Method Detail
acceptsArguments
boolean acceptsArguments()(Code)



argumentDescription
String argumentDescription()(Code)



argumentType
Class argumentType()(Code)



canConvertArgument
protected boolean canConvertArgument(String argument)(Code)
Tells whether the given argument can be successfully converted to the type specified in this spec, if one was given.
Parameters:
  argument - the argument to convert true if conversion would be successful



convert
final protected Object convert(String argument)(Code)
Converts the given argument to the type specified in this spec, if one was given.
Parameters:
  argument - the argument to convert the converted argument, or itself if no conversion was specified



describedAs
final public ArgumentAcceptingOptionSpec describedAs(String description)(Code)
Specifies a description for the argument of the option that this spec represents. This description is used when generating help information about the parser.
Parameters:
  description - describes the nature of the argument of this spec'soption self, so that the caller can add clauses to the domain-specific sentence



equals
public boolean equals(Object that)(Code)



handleOption
final void handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument)(Code)



handleOptionFurther
abstract protected void handleOptionFurther(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions)(Code)
Provides additional handling of this option when detected. TODO: need a better name here.
Parameters:
  parser - an option parser
Parameters:
  arguments - an argument list
Parameters:
  detectedOptions - set of options detected in the argument list so far



hashCode
public int hashCode()(Code)



isArgumentOfNumberType
protected boolean isArgumentOfNumberType()(Code)
Tells whether this option spec converts its arguments to a number type. whether this option spec converts its arguments to a number type



ofType
public void ofType(Class argumentType)(Code)

Specifies a type to which arguments of this spec's option are to be converted.

JOpt Simple accepts types that have either:

  1. a public static method called valueOf which accepts a single argument of type String and whose return type is the same as the class on which the method is declared. The java.lang primitive wrapper classes have such methods.
  2. a constructor which accepts a single argument of type String .

This class converts arguments using those methods in that order; that is, valueOf would be invoked before a one- String -arg constructor would.


Parameters:
  argumentType - desired type of arguments to this spec's option
throws:
  NullPointerException - if the type is null
throws:
  IllegalArgumentException - if the type does not have the standard conversionmethods



requiresArgument
boolean requiresArgument()(Code)



toString
public String toString()(Code)



Methods inherited from joptsimple.OptionSpec
abstract void accept(OptionSpecVisitor visitor)(Code)(Java Doc)
abstract boolean acceptsArguments()(Code)(Java Doc)
String description()(Code)(Java Doc)
public boolean equals(Object that)(Code)(Java Doc)
abstract void handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
String option()(Code)(Java Doc)
abstract boolean requiresArgument()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.