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

ExternalCommand (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.cmdline.exec
Class ExternalCommand

java.lang.Object
  extended byorg.netbeans.modules.vcscore.cmdline.exec.ExternalCommand
All Implemented Interfaces:
TextInput

public class ExternalCommand
extends Object
implements TextInput

Single external command to be executed. See TestCommand for typical usage.


Constructor Summary
ExternalCommand()
          Creates new ExternalCommand
ExternalCommand(String command)
           
ExternalCommand(String command, String input)
           
ExternalCommand(StructuredExec sexec)
           
 
Method Summary
 void addImmediateTextErrorListener(TextOutputListener l)
          Add a listener to the standard error output, that will be noified immediately as soon as the output text is available.
 void addImmediateTextOutputListener(TextOutputListener l)
          Add a listener to the standard output, that will be noified immediately as soon as the output text is available.
 void addOutputProgressListener(OutputProgressListener l)
          Add an output progress listener that is notified about the progress of output that is available from the command.
 void addRegexErrorListener(RegexOutputListener l, String regex)
          Add a listener to the standard error output with a specific regular expression.
 void addRegexOutputListener(RegexOutputListener l, String regex)
          Add a listener to the standard output with a specific regular expression.
 void addTextErrorListener(TextOutputListener l)
          Add a listener to the standard error output.
 void addTextOutputListener(TextOutputListener l)
          Add a listener to the standard output.
 int exec()
          Executes the external command.
 int getExitStatus()
          Get the exit status of the command.
static String[] matchToStringArray(Pattern pattern, String line)
           
static String[] parseParameters(StructuredExec sexec)
           
 void removeRegexErrorListener(RegexOutputListener l)
          Remove an error output data listener.
 void removeRegexOutputListener(RegexOutputListener l)
          Remove a standard output data listener.
 void sendInput(String inputData)
          Send some input data to a running command.
 void setCommand(String command)
           
 void setCommand(StructuredExec scommand)
           
 void setEnv(String[] envp)
           
 void setInput(String inputData, boolean repeat)
          Set the input, which will be send to the command standard input.
 void setMergeOutputStreams(boolean mergeOutputStreams)
          Whether to merge the error output with standard output.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalCommand

public ExternalCommand()
Creates new ExternalCommand


ExternalCommand

public ExternalCommand(String command)

ExternalCommand

public ExternalCommand(String command,
                       String input)

ExternalCommand

public ExternalCommand(StructuredExec sexec)
Method Detail

setCommand

public void setCommand(String command)

setCommand

public void setCommand(StructuredExec scommand)

setInput

public void setInput(String inputData,
                     boolean repeat)
Set the input, which will be send to the command standard input.

Parameters:
inputData - The String data that will be sent to the command standard input
repeat - Whether the input sequence should be repeated while the command reads it.

sendInput

public void sendInput(String inputData)
Send some input data to a running command. This will do nothing if the input is repeated.

Specified by:
sendInput in interface TextInput
Parameters:
inputData - The input text.

setEnv

public void setEnv(String[] envp)

setMergeOutputStreams

public void setMergeOutputStreams(boolean mergeOutputStreams)
Whether to merge the error output with standard output. Supported only on JDK 1.5.x and higher.


getExitStatus

public int getExitStatus()
Get the exit status of the command.


parseParameters

public static String[] parseParameters(StructuredExec sexec)

exec

public int exec()
Executes the external command.


toString

public String toString()

addRegexOutputListener

public void addRegexOutputListener(RegexOutputListener l,
                                   String regex)
                            throws BadRegexException
Add a listener to the standard output with a specific regular expression.

Throws:
BadRegexException

addRegexErrorListener

public void addRegexErrorListener(RegexOutputListener l,
                                  String regex)
                           throws BadRegexException
Add a listener to the standard error output with a specific regular expression.

Throws:
BadRegexException

addTextOutputListener

public void addTextOutputListener(TextOutputListener l)
Add a listener to the standard output.


addTextErrorListener

public void addTextErrorListener(TextOutputListener l)
Add a listener to the standard error output.


addImmediateTextOutputListener

public void addImmediateTextOutputListener(TextOutputListener l)
Add a listener to the standard output, that will be noified immediately as soon as the output text is available. It does not wait for the new line and does not send output line-by-line.


addImmediateTextErrorListener

public void addImmediateTextErrorListener(TextOutputListener l)
Add a listener to the standard error output, that will be noified immediately as soon as the output text is available. It does not wait for the new line and does not send output line-by-line.


addOutputProgressListener

public void addOutputProgressListener(OutputProgressListener l)
Add an output progress listener that is notified about the progress of output that is available from the command.


removeRegexOutputListener

public void removeRegexOutputListener(RegexOutputListener l)
Remove a standard output data listener.


removeRegexErrorListener

public void removeRegexErrorListener(RegexOutputListener l)
Remove an error output data listener.


matchToStringArray

public static String[] matchToStringArray(Pattern pattern,
                                          String line)

 

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