安慰
public class Console
extends Object
java.lang.Object | |
↳ | com.android.tradefed.command.Console |
TradeFederation 主控制台提供使用者互動介面
目前支援以下操作
- 新增一個指令來測試
- 列出設備及其狀態
- 列出正在進行的調用
- 列出隊列中的命令
- 將呼叫日誌轉儲到檔案/stdout
- 關閉
概括
嵌套類 | |
---|---|
class | Console.ArgRunnable <T> 具有可接受參數的 |
class | Console.CaptureList |
領域 | |
---|---|
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,則傳回 |
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
受保護的構造函數
安慰
protected Console ()
公共方法
跑步
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 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)
子類別可用於變更控制台中可用命令的自訂點。
實作應修改genericHelp
和commandHelp
變數以記錄它們可能添加、修改或刪除的功能。
參數 | |
---|---|
trie | RegexTrie :要新增指令的RegexTrie |
genericHelp | ERROR(/List) 行。 |
commandHelp | ERROR(/Map) 包含可能已新增的任何新命令的文檔。鍵是用作RegexTrie 鍵的正規表示式。該值應該是一個字串,其中包含要為該命令列印的幫助文字。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]