View Javadoc

1   package org.lsst.ccs.command;
2   
3   import java.lang.reflect.Method;
4   import java.util.Collection;
5   
6   /**
7    * interface to define a "Local" Command Dictionary on a per-class basis. It can
8    * deliver a <TT>Dictionary</TT> and find a <TT>Method</TT> Object. "Local"
9    * means it can be used only where it is built and cannot be exported (these
10   * objects are not <TT>Serializable</TT>)
11   *
12   * @author bamade
13   */
14  public interface LocalCommandDictionary {
15  
16  	/**
17  	 * Gets the command dictionary.
18  	 *
19  	 * @return The command dictionary.
20  	 */
21  	public Dictionary getCommandDictionary();
22  
23  	/**
24  	 * Finds the method which should be invoked as a result of a particular
25  	 * command.
26  	 *
27  	 * @param command The command to be invoked
28  	 * @return The method to be called to invoke the command, or
29  	 * <code>null</code> if the command is not known.
30  	 */
31  	public Method getMethod(BasicCommand command);
32  
33  	/**
34  	 * *
35  	 * Finds a <TT>Method</TT> which is linked to a
36  	 * <TT>DictionaryCommand</TT>.
37  	 *
38  	 * @param dc a dictionary command that <B>must</b> be extracted from the
39  	 * current <TT>Dictionary</TT>
40  	 * @return The method to be called to invoke the command, or
41  	 * <code>null</code> if the command is not known.
42  	 */
43  	public Method getMethod(DictionaryCommand dc);
44  
45      /**
46       * @return all the methods that are commands
47       */
48      public Collection<Method> getMethods() ;
49  
50  }