Class ConsoleInterpreter


  • public class ConsoleInterpreter
    extends Object
    This class provides generic methods for handling console input (i.e. pure strings). NOTE: This class is only kept for backward compatibility so that openHAB 1 Add-ons still compile. It must not be used productively!
    Author:
    Kai Kreuzer - Initial contribution
    • Constructor Detail

      • ConsoleInterpreter

        public ConsoleInterpreter()
    • Method Detail

      • handleRequest

        public static void handleRequest​(String[] args,
                                         Console console)
        This method simply takes a list of arguments, where the first one is treated as the console command (such as "update", "send" etc.). The following entries are then the arguments for this command. If the command is unknown, the complete usage is printed to the console.
        Parameters:
        args - array which contains the console command and all its arguments
        console - the console for printing messages for the user
      • handleUpdate

        public static void handleUpdate​(String[] args,
                                        Console console)
        This method handles an update command.
        Parameters:
        args - array which contains the arguments for the update command
        console - the console for printing messages for the user
      • handleSend

        public static void handleSend​(String[] args,
                                      Console console)
        This method handles a send command.
        Parameters:
        args - array which contains the arguments for the send command
        console - the console for printing messages for the user
      • handleItems

        public static void handleItems​(String[] args,
                                       Console console)
        This method handles an items command.
        Parameters:
        args - array which contains the arguments for the items command
        console - the console for printing messages for the user
      • handleStatus

        public static void handleStatus​(String[] args,
                                        Console console)
        This method handles a status command.
        Parameters:
        args - array which contains the arguments for the status command
        console - the console for printing messages for the user
      • handleSay

        public static void handleSay​(String[] args,
                                     Console console)
        This method handles a say command.
        Parameters:
        args - array which contains the arguments for the status command
        console - the console for printing messages for the user
      • handleScript

        public static void handleScript​(String[] args,
                                        Console console)
      • getUsages

        public static String[] getUsages()
        returns an array of the usage texts for all available commands
      • getUpdateUsage

        public static String getUpdateUsage()
      • getCommandUsage

        public static String getCommandUsage()
      • getStatusUsage

        public static String getStatusUsage()
      • getItemsUsage

        public static String getItemsUsage()
      • getSayUsage

        public static String getSayUsage()
      • getScriptUsage

        public static String getScriptUsage()