站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

CommandLine (Command Line Parsing API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.sendopts/2 2.0

org.netbeans.api.sendopts
Class CommandLine

java.lang.Object
  extended by org.netbeans.api.sendopts.CommandLine

public final class CommandLine
extends Object

A class for clients that have an array of strings and want to process it - e.g. parse it and also invoke registered OptionProcessors.


Method Summary
static CommandLine getDefault()
          Getter for the default command line processor in the system.
 void process(String[] args)
          Process the array of arguments and invoke associated OptionProcessors.
 void process(String[] args, InputStream is, OutputStream os, OutputStream err, File currentDir)
          Process the array of arguments and invoke associated OptionProcessors.
 void usage(PrintWriter w)
          Prints the usage information about options provided by associated OptionProcessors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefault

public static CommandLine getDefault()
Getter for the default command line processor in the system. List of OptionProcessors is taken from default Lookup.getDefault.


process

public void process(String[] args)
             throws CommandException
Process the array of arguments and invoke associated OptionProcessors.

Parameters:
args - the array of strings to process
Throws:
CommandException - if processing is not possible or failed

process

public void process(String[] args,
                    InputStream is,
                    OutputStream os,
                    OutputStream err,
                    File currentDir)
             throws CommandException
Process the array of arguments and invoke associated OptionProcessors.

Parameters:
args - the array of strings to process
is - the input stream that processors can read
os - the output stream that processors can write to
err - the output stream that processors can send error messages to
currentDir - directory that processors should use as current user dir
Throws:
CommandException - if processing is not possible or failed

usage

public void usage(PrintWriter w)
Prints the usage information about options provided by associated OptionProcessors.

Parameters:
w - the writer to output usage info to
Since:
1.7

org.netbeans.modules.sendopts/2 2.0

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.