KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > console > CommandProvider


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.osgi.framework.console;
13
14 /**
15  When an object wants to provide a number of commands
16  to the console, it should register an object with this
17  interface. Some console can then pick this up and execute
18  command lines.
19  The SERVICE_RANKING registration property can be used to influence the
20  order that a CommandProvider gets called. Specify a value less than
21  Integer.MAXVALUE, where higher is more significant. The default value
22  if SERVICE_RANKING is not set is 0.
23  <p>
24  The interface contains only methods for the help.
25  The console should use inspection
26  to find the commands. All public commands, starting with
27  a '_' and taking a CommandInterpreter as parameter
28  will be found. E.g.
29  <pre>
30  public Object _hello( CommandInterpreter intp ) {
31  return "hello " + intp.nextArgument();
32  }
33  </pre>
34  * <p>
35  * Clients may implement this interface.
36  * </p>
37  * @since 3.1
38  */

39 public interface CommandProvider {
40     /**
41      Answer a string (may be as many lines as you like) with help
42      texts that explain the command.
43      */

44     public String JavaDoc getHelp();
45
46 }
47
Popular Tags