IConfigurationFactory

public interface IConfigurationFactory

com.android.tradefed.config.IConfigurationFactory


用於建立 IConfiguration 的工廠

摘要

公用方法

abstract IConfiguration createConfigurationFromArgs(String[] args, unconsumedArgs)

透過指令列引數建立 IConfiguration

abstract IConfiguration createConfigurationFromArgs(String[] args)

便利方法,會使用 null 做為第二個引數呼叫 ERROR(/#createConfigurationFromArgs(String[],List))

abstract IConfiguration createConfigurationFromArgs(String[] args, unconsumedArgs, IKeyStoreClient keyStoreClient)

使用金鑰存放區,透過指令列引數建立 IConfiguration

abstract IGlobalConfiguration createGlobalConfigurationFromArgs(String[] args, nonGlobalArgs)

透過指令列引數建立 IGlobalConfiguration

abstract IConfiguration createPartialConfigurationFromArgs(String[] arrayArgs, IKeyStoreClient keyStoreClient, allowedObjects, TradefedDelegator delegator)

建立只包含一組所選物件的設定。

abstract void dumpConfig(String configName, PrintStream out)

將設定內容轉儲至指定的 ERROR(/PrintStream)

abstract getConfigList()

傳回 classpath 中 JAR 所找到的所有設定名稱清單。

abstract getConfigList(String subPath, boolean loadFromEnv)

getConfigList() 的變化版本,可用於指定是否也要從環境載入設定。

abstract void printHelp(PrintStream out)

列印此工廠的說明輸出內容。

abstract void printHelpForConfig(String[] args, boolean importantOnly, PrintStream out)

針對指令列引數中指定的 IConfiguration,列印說明輸出內容。

如果「args」是指已知的設定,系統會從 XML 建立 IConfiguration 物件,並輸出該 IConfiguration 的說明。

公用方法

createConfigurationFromArgs

public abstract IConfiguration createConfigurationFromArgs (String[] args, 
                 unconsumedArgs)

透過指令列引數建立 IConfiguration

預期格式為「CONFIG [選項]」,其中 CONFIG 是內建設定名稱或設定 XML 檔案的檔案路徑。

參數
args String:指令列引數

unconsumedArgs :清單,會填入與指定設定相關聯的物件未使用到的引數。如果是 null,則如果有任何未處理的引數,實作會擲回 ConfigurationException

傳回
IConfiguration 載入的 IConfiguration。委派物件 Option 欄位已填入 args 中的值。

擲回
ConfigurationException 如果無法載入設定,

createConfigurationFromArgs

public abstract IConfiguration createConfigurationFromArgs (String[] args)

便利方法,會使用 null 的第二個引數呼叫 ERROR(/#createConfigurationFromArgs(String[],List))。因此,如果仍有未使用的引數,就會擲回 ConfigurationException

參數
args String

傳回
IConfiguration

擲回
ConfigurationException

createConfigurationFromArgs

public abstract IConfiguration createConfigurationFromArgs (String[] args, 
                 unconsumedArgs, 
                IKeyStoreClient keyStoreClient)

使用金鑰庫,透過指令列引數建立 IConfiguration

預期格式為「CONFIG [選項]」,其中 CONFIG 是內建設定名稱或設定 XML 檔案的檔案路徑。

參數
args String:指令列引數

unconsumedArgs :清單,會填入與指定設定相關聯的物件未使用到的引數。如果是 null,則如果有任何未處理的引數,實作會擲回 ConfigurationException

keyStoreClient IKeyStoreClient:用於在 args 中取得機密資訊的 IKeyStoreClient

傳回
IConfiguration 已載入的 IConfiguration。委派物件 Option 欄位已填入 args 中的值。

擲回
ConfigurationException 無法載入設定

createGlobalConfigurationFromArgs

public abstract IGlobalConfiguration createGlobalConfigurationFromArgs (String[] args, 
                 nonGlobalArgs)

從指令列引數建立 IGlobalConfiguration

預期格式為「CONFIG [選項]」,其中 CONFIG 是內建的設定名稱或設定檔路徑。

參數
args String:指令列引數

nonGlobalArgs :這個清單會填入未以全局引數處理的引數

傳回
IGlobalConfiguration 已載入的 IGlobalConfiguration。委派物件 Option 欄位已填入 args 中的值。

擲回
ConfigurationException 無法載入設定

createPartialConfigurationFromArgs

public abstract IConfiguration createPartialConfigurationFromArgs (String[] arrayArgs, 
                IKeyStoreClient keyStoreClient, 
                 allowedObjects, 
                TradefedDelegator delegator)

建立只包含一組所選物件的設定。

參數
arrayArgs String:指令列引數

keyStoreClient IKeyStoreClient:用於取得引數中機密資訊的 IKeyStoreClient

allowedObjects :要建立的允許物件組合

delegator TradefedDelegator

傳回
IConfiguration 已載入的 IConfiguration

擲回
ConfigurationException 無法載入設定

dumpConfig

public abstract void dumpConfig (String configName, 
                PrintStream out)

將設定內容轉存至指定的 ERROR(/PrintStream)

參數
configName String:設定名稱

out PrintStream:指定要將輸出內容轉儲到哪個 ERROR(/PrintStream)

getConfigList

public abstract  getConfigList ()

傳回 classpath 中 JAR 檔案中找到的所有設定名稱清單。不會嘗試載入任何設定,因此清單中可能會有無法運作的設定。

傳回

getConfigList

public abstract  getConfigList (String subPath, 
                boolean loadFromEnv)

getConfigList() 的變化版本,可用於指定是否也要從環境載入設定。

參數
subPath String:要查看設定的子目錄名稱。如果為空值,則會與 getConfigList() 的行為相同。

loadFromEnv boolean:如果應在環境變數中載入設定,則為 True。

傳回

列印說明

public abstract void printHelp (PrintStream out)

列印此工廠的說明輸出內容。

列印一般說明資訊,並列出所有可用的設定。

參數
out PrintStream:要傾印輸出的 ERROR(/PrintStream)

printHelpForConfig

public abstract void printHelpForConfig (String[] args, 
                boolean importantOnly, 
                PrintStream out)

針對指令列引數中指定的 IConfiguration,列印說明輸出內容。

如果「args」是指已知的設定,系統會從 XML 建立 IConfiguration 物件,並輸出該 IConfiguration 的說明。請注意,系統會忽略所有其他「args」值 (也就是說明文字會描述從 XML 載入的 Option 目前值,而不會反映指令列 args 所設定的選項值)。

如果「args」未參照已知的 IConfiguration,系統會顯示通用的 printHelp(PrintStream) 說明。

參數
args String:指令列引數

importantOnly boolean:如果為 true,則列印簡短的說明,只列出重要詳細資料

out PrintStream:要傾印輸出的 ERROR(/PrintStream)