Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.osgi.framework.console
Interface CommandInterpreter  view CommandInterpreter download CommandInterpreter.java


public interface CommandInterpreter

A command interpreter is a shell that can interpret command lines. This object is passed as parameter when a CommandProvider is invoked.


Method Summary
 java.lang.Object execute(java.lang.String cmd)
          Execute a command line as if it came from the end user and return the result.
 java.lang.String nextArgument()
          Get the next argument in the input.
 void print(java.lang.Object o)
          Prints an object to the outputstream
 void printBundleResource(org.eclipse.osgi.framework.internal.core.AbstractBundle bundle, java.lang.String resource)
          Prints the given bundle resource if it exists
 void printDictionary(java.util.Dictionary dic, java.lang.String title)
          Prints the given dictionary sorted by keys.
 void println()
          Prints an empty line to the outputstream
 void println(java.lang.Object o)
          Prints an object to the output medium (appended with newline character).
 void printStackTrace(java.lang.Throwable t)
          Print a stack trace including nested exceptions.
 

Method Detail

nextArgument

public java.lang.String nextArgument()
Get the next argument in the input. E.g. if the commandline is hello world, the _hello method will get "world" as the first argument.


execute

public java.lang.Object execute(java.lang.String cmd)
Execute a command line as if it came from the end user and return the result. Throws any exceptions generated by the command that executed.


print

public void print(java.lang.Object o)
Prints an object to the outputstream


println

public void println()
Prints an empty line to the outputstream


println

public void println(java.lang.Object o)
Prints an object to the output medium (appended with newline character).

If running on the target environment the user is prompted with '--more' if more than the configured number of lines have been printed without user prompt. That way the user of the program has control over the scrolling.

For this to work properly you should not embedded "\n" etc. into the string.


printStackTrace

public void printStackTrace(java.lang.Throwable t)
Print a stack trace including nested exceptions.


printDictionary

public void printDictionary(java.util.Dictionary dic,
                            java.lang.String title)
Prints the given dictionary sorted by keys.


printBundleResource

public void printBundleResource(org.eclipse.osgi.framework.internal.core.AbstractBundle bundle,
                                java.lang.String resource)
Prints the given bundle resource if it exists