콘솔
public
class
Console
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.command.Console |
사용자가 상호작용할 수 있는 인터페이스를 제공하는 기본 TradeFederation 콘솔
현재 다음과 같은 작업을 지원합니다.
- 테스트할 명령어 추가
- 기기와 기기 상태 나열
- 진행 중인 호출 목록
- 대기열의 명령어 나열
- 호출 로그를 파일/stdout에 덤프
- 종료
요약
중첩된 클래스 | |
|---|---|
class |
Console.ArgRunnable<T>
인수를 사용할 수 있는 |
class |
Console.CaptureList
|
상수 | |
|---|---|
String |
DEBUG_PATTERN
|
String |
DUMP_PATTERN
|
String |
EXIT_PATTERN
|
String |
HELP_PATTERN
|
String |
INVOC_PATTERN
|
String |
LIST_COMMANDS_PATTERN
|
String |
LIST_PATTERN
|
String |
REMOVE_PATTERN
|
String |
RUN_PATTERN
|
String |
SET_PATTERN
|
String |
VERSION_PATTERN
|
필드 | |
|---|---|
protected
static
final
String |
LINE_SEPARATOR
|
protected
LineReader |
mConsoleReader
|
protected
IKeyStoreFactory |
mKeyStoreFactory
|
protected
ICommandScheduler |
mScheduler
|
보호된 생성자 | |
|---|---|
Console()
|
|
공개 메서드 | |
|---|---|
static
void
|
main(String[] mainArgs)
|
void
|
run()
콘솔을 실행하는 기본 메서드입니다. |
void
|
setArgs(
콘솔 시작 인수를 설정합니다. |
static
void
|
startConsole(Console console, String[] args)
지정된 인수로 지정된 Tradefed 콘솔을 시작합니다. |
보호된 메서드 | |
|---|---|
String
|
getConsolePrompt()
|
String
|
getGenericHelpString(
표시할 일반 도움말 문자열 반환 |
static
LineReader
|
getReader()
새 LineReader를 반환하거나 IOException이 발생하면 |
void
|
printLine(String output)
콘솔에 텍스트 줄 표시 |
void
|
printLine(String output, PrintStream pw)
Printwriter에 줄을 인쇄합니다. |
void
|
setCustomCommands(RegexTrie<Runnable> trie,
하위 클래스가 콘솔에서 사용할 수 있는 명령어를 변경하는 데 사용할 수 있는 맞춤설정 포인트입니다. |
상수
DEBUG_PATTERN
protected static final String DEBUG_PATTERN
상수 값: 'debug'
DUMP_PATTERN
protected static final String DUMP_PATTERN
상수 값: "d(?:ump)?"
EXIT_PATTERN
protected static final String EXIT_PATTERN
상수 값: "(?:q|exit)"
HELP_PATTERN
protected static final String HELP_PATTERN
상수 값: "\?|h|help"
INVOC_PATTERN
protected static final String INVOC_PATTERN
상수 값: "i(?:nvocation)?"
LIST_COMMANDS_PATTERN
protected static final String LIST_COMMANDS_PATTERN
상수 값: 'c(?:ommands)?'
LIST_PATTERN
protected static final String LIST_PATTERN
상수 값: "l(?:ist)?"
REMOVE_PATTERN
protected static final String REMOVE_PATTERN
상수 값: 'remove'
RUN_PATTERN
protected static final String RUN_PATTERN
상수 값: "r(?:un)?"
SET_PATTERN
protected static final String SET_PATTERN
상수 값: "s(?:et)?"
VERSION_PATTERN
protected static final String VERSION_PATTERN
상수 값: "version"
필드
LINE_SEPARATOR
protected static final String LINE_SEPARATOR
mConsoleReader
protected LineReader mConsoleReader
보호된 생성자
콘솔
protected Console ()
공개 메서드
실행
public void run ()
콘솔을 실행하는 기본 메서드입니다. 종료 명령어가 실행될 때까지 계속 실행됩니다.
setArgs
public void setArgs (mainArgs)
콘솔 시작 인수를 설정합니다.
| 매개변수 | |
|---|---|
mainArgs |
: 인수 |
startConsole
public static void startConsole (Console console, String[] args)
지정된 인수로 지정된 Tradefed 콘솔을 시작합니다.
| 매개변수 | |
|---|---|
console |
Console: 시작할 Console |
args |
String: 명령줄 인수 |
| 생성 값 | |
|---|---|
ConfigurationException |
|
보호된 메서드
getGenericHelpString
protected String getGenericHelpString (genericHelp)
표시할 일반 도움말 문자열 반환
| 매개변수 | |
|---|---|
genericHelp |
: 집계할 일반 도움말을 나타내는 String 목록입니다. |
| 반환 값 | |
|---|---|
String |
|
getReader
protected static LineReader getReader ()
새 LineReader를 반환하거나 IOException이 발생하면 null를 반환합니다. 이 함수는 슈퍼클래스 생성자 전에 실행할 수 있도록 정적이어야 합니다.
| 반환 값 | |
|---|---|
LineReader |
|
printLine
protected void printLine (String output)
콘솔에 텍스트 줄 표시
printLine
protected void printLine (String output,
PrintStream pw)Printwriter에 줄을 인쇄합니다.
| 매개변수 | |
|---|---|
pw |
PrintStream |
setCustomCommands
protected void setCustomCommands (RegexTrie<Runnable> trie,genericHelp, commandHelp)
하위 클래스가 콘솔에서 사용할 수 있는 명령어를 변경하는 데 사용할 수 있는 맞춤설정 포인트입니다.
구현에서는 genericHelp 및 commandHelp 변수를 수정하여 추가, 수정 또는 삭제한 기능을 문서화해야 합니다.
| 매개변수 | |
|---|---|
trie |
RegexTrie: 명령어를 추가할 RegexTrie |
genericHelp |
: 사용자가 인수가 없는 'help' 명령어를 실행할 때 출력할 줄의 ERROR(/List)입니다. |
commandHelp |
: 새로 추가된 명령의 문서를 포함하는 ERROR(/Map)입니다. 키는 RegexTrie의 키로 사용할 정규 표현식입니다. 값은 해당 명령어에 대해 출력할 도움말 텍스트를 포함하는 문자열이어야 합니다. |