콘솔

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)

인쇄기로 라인 인쇄

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

서브클래스가 콘솔에서 사용할 수 있는 명령을 변경하는 데 사용할 수 있는 사용자 정의 지점입니다.

필드

DEBUG_PATTERN

protected static final String DEBUG_PATTERN

DUMP_PATTERN

protected static final String DUMP_PATTERN

EXIT_PATTERN

protected static final String EXIT_PATTERN

HELP_PATTERN

protected static final String HELP_PATTERN

INVOC_PATTERN

protected static final String INVOC_PATTERN

LINE_SEPARATOR

protected static final String LINE_SEPARATOR

LIST_COMMANDS_PATTERN

protected static final String LIST_COMMANDS_PATTERN

LIST_PATTERN

protected static final String LIST_PATTERN

REMOVE_PATTERN

protected static final String REMOVE_PATTERN

런_패턴

protected static final String RUN_PATTERN

SET_PATTERN

protected static final String SET_PATTERN

VERSION_PATTERN

protected static final String VERSION_PATTERN

mConsoleReader

protected LineReader mConsoleReader

mKeyStoreFactory

protected IKeyStoreFactory mKeyStoreFactory

mScheduler

protected ICommandScheduler mScheduler

보호된 생성자

콘솔

protected Console ()

공개 메소드

기본

public static void main (String[] mainArgs)

매개변수
mainArgs String

던지기
ConfigurationException

달리다

public void run ()

콘솔을 실행하는 주요 방법입니다. 종료 명령이 실행될 때까지 계속 실행됩니다.

setArgs

public void setArgs ( mainArgs)

콘솔 시작 인수를 설정합니다.

매개변수
mainArgs : 인수

시작콘솔

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

지정된 인수로 지정된 Tradefed 콘솔을 시작합니다.

매개변수
console Console : 시작할 Console

args String : 명령줄 인수

던지기
ConfigurationException

보호된 방법

getConsolePrompt

protected String getConsolePrompt ()

보고
String 콘솔 프롬프트에 표시할 텍스트 String

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)

인쇄기로 라인 인쇄

매개변수
pw PrintStream

setCustomCommands

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

서브클래스가 콘솔에서 사용할 수 있는 명령을 변경하는 데 사용할 수 있는 사용자 정의 지점입니다.

구현 시 genericHelpcommandHelp 변수를 수정하여 추가, 수정 또는 제거된 기능을 문서화해야 합니다.

매개변수
trie RegexTrie : 명령을 추가할 RegexTrie

genericHelp : 사용자가 인수 없이 "help" 명령을 실행할 때 인쇄할 줄의 ERROR(/List) 입니다.

commandHelp : 추가되었을 수 있는 새 명령에 대한 문서가 포함된 ERROR(/Map) 입니다. 키는 RegexTrie 의 키로 사용할 정규식입니다. 값은 해당 명령에 대해 인쇄할 도움말 텍스트가 포함된 문자열이어야 합니다.