安慰

public class Console
extends Object

java.lang.Object
com.android.tradefed.command.Console


TradeFederation 主控制台为用户提供交互界面

目前支持以下操作

  • 添加一个命令来测试
  • 列出设备及其状态
  • 列出正在进行的调用
  • 列出队列中的命令
  • 将调用日志转储到文件/stdout
  • 关闭

概括

嵌套类

class Console.ArgRunnable <T>

具有可以接受参数的run方法的Runnable

class Console.CaptureList

List<List<String>>的便捷类型

领域

protected static final String DEBUG_PATTERN

protected static final String DUMP_PATTERN

protected static final String EXIT_PATTERN

protected static final String HELP_PATTERN

protected static final String INVOC_PATTERN

protected static final String LINE_SEPARATOR

protected static final String LIST_COMMANDS_PATTERN

protected static final String LIST_PATTERN

protected static final String REMOVE_PATTERN

protected static final String RUN_PATTERN

protected static final String SET_PATTERN

protected static final String VERSION_PATTERN

protected LineReader mConsoleReader

protected IKeyStoreFactory mKeyStoreFactory

protected ICommandScheduler mScheduler

受保护的构造函数

Console ()

公共方法

static void main (String[] mainArgs)
void run ()

启动控制台的主要方法。

void setArgs ( mainArgs) setArgs ( mainArgs)

设置控制台起始参数。

static void startConsole ( Console console, String[] args)

使用给定参数启动给定 Tradefed 控制台

受保护的方法

String getConsolePrompt ()
String getGenericHelpString ( genericHelp) getGenericHelpString ( genericHelp)

返回要显示的通用帮助字符串

static LineReader getReader ()

返回一个新的 LineReader,如果发生 IOException,则返回null

void printLine (String output)

在控制台上显示一行文本

void printLine (String output, PrintStream pw)

将行打印到 Printwriter

void setCustomCommands ( RegexTrie <Runnable> trie, genericHelp, commandHelp) setCustomCommands ( RegexTrie <Runnable> trie, genericHelp, commandHelp) setCustomCommands ( RegexTrie <Runnable> trie, genericHelp, commandHelp)

子类可用于更改控制台中可用命令的自定义点。

领域

调试模式

protected static final String DEBUG_PATTERN

转储_模式

protected static final String DUMP_PATTERN

退出模式

protected static final String EXIT_PATTERN

帮助模式

protected static final String HELP_PATTERN

INVOC_PATTERN

protected static final String INVOC_PATTERN

LINE_SEPARATOR

protected static final String LINE_SEPARATOR

列表命令模式

protected static final String LIST_COMMANDS_PATTERN

列表_模式

protected static final String LIST_PATTERN

移除_模式

protected static final String REMOVE_PATTERN

运行模式

protected static final String RUN_PATTERN

设置模式

protected static final String SET_PATTERN

版本_模式

protected static final String VERSION_PATTERN

mConsoleReader

protected LineReader mConsoleReader

mKeyStoreFactory

protected IKeyStoreFactory mKeyStoreFactory

调度程序

protected ICommandScheduler mScheduler

受保护的构造函数

安慰

protected Console ()

公共方法

主要的

public static void main (String[] mainArgs)

参数
mainArgs String

投掷
ConfigurationException

跑步

public void run ()

启动控制台的主要方法。将继续运行,直到发出关闭命令。

设置参数

public void setArgs ( mainArgs)

设置控制台起始参数。

参数
mainArgs : 论据

启动控制台

public static void startConsole (Console console, 
                String[] args)

使用给定参数启动给定 Tradefed 控制台

参数
console Console :要启动的Console

args String : 命令行参数

投掷
ConfigurationException

受保护的方法

获取控制台提示符

protected String getConsolePrompt ()

退货
String为控制台提示符显示的文本String

获取通用帮助字符串

protected String getGenericHelpString ( genericHelp)

返回要显示的通用帮助字符串

参数
genericHelp :表示要聚合的通用帮助的String列表。

退货
String

获取阅读器

protected static LineReader getReader ()

返回一个新的 LineReader,如果发生 IOException,则返回null 。请注意,该函数必须是静态的,以便我们可以在超类构造函数之前运行它。

退货
LineReader

打印行

protected void printLine (String output)

在控制台上显示一行文本

打印行

protected void printLine (String output, 
                PrintStream pw)

将行打印到 Printwriter

参数
pw PrintStream

设置自定义命令

protected void setCustomCommands (RegexTrie<Runnable> trie, 
                 genericHelp, 
                 commandHelp)

子类可用于更改控制台中可用命令的自定义点。

实现应修改genericHelpcommandHelp变量以记录它们可能添加、修改或删除的功能。

参数
trie RegexTrie :要添加命令的RegexTrie

genericHelp :当用户运行不带参数的“help”命令时要打印的ERROR(/List)行。

commandHelpERROR(/Map)包含可能已添加的任何新命令的文档。键是用作RegexTrie键的正则表达式。该值应该是一个字符串,其中包含要为该命令打印的帮助文本。