ConfigurationFactory

public class ConfigurationFactory
extends Object implements IConfigurationFactory

java.lang.Object
com.android.tradefed.config.ConfigurationFactory


IConfigurationを作成するためのファクトリ。

まとめ

ネストされたクラス

class ConfigurationFactory.ConfigLoader

1 つのルート構成からインクルードされた構成を追跡し、循環インクルードで例外をスローするIConfigDefLoaderの実装。

class ConfigurationFactory.ExceptionLoader

保護されたコンストラクター

ConfigurationFactory ()

公開メソッド

void clearMapConfig ()

特定のケースでは、マップをクリアする必要があります。

IConfiguration createConfigurationFromArgs (String[] arrayArgs, unconsumedArgs) createConfigurationFromArgs (String[] arrayArgs, unconsumedArgs)

コマンド ライン引数からIConfigurationを作成します。

IConfiguration createConfigurationFromArgs (String[] arrayArgs, unconsumedArgs, IKeyStoreClient keyStoreClient) createConfigurationFromArgs (String[] arrayArgs, unconsumedArgs, IKeyStoreClient keyStoreClient)

キー ストアを使用して、コマンド ライン引数からIConfigurationを作成します。

IConfiguration createConfigurationFromArgs (String[] arrayArgs)

nullの 2 番目の引数をERROR(/#createConfigurationFromArgs(String[],List))呼び出す便利なメソッド。

IGlobalConfiguration createGlobalConfigurationFromArgs (String[] arrayArgs, remainingArgs) createGlobalConfigurationFromArgs (String[] arrayArgs, remainingArgs)

コマンド ライン引数からIGlobalConfigurationを作成します。

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

選択したオブジェクトのセットのみを含む構成を作成します。

void dumpConfig (String configName, PrintStream out)

構成の内容を指定されたERROR(/PrintStream)にダンプします。

getConfigList (String subPath, boolean loadFromEnv)

環境から構成をロードするかどうかを指定できるgetConfigList()のバリエーション。

getConfigList ()

クラスパスの JAR で見つかったすべての構成の名前のリストを返します。

static IConfigurationFactory getInstance ()

シングルトンIConfigurationFactoryインスタンスを取得します。

void loadAllConfigs (boolean discardExceptions)

クラスパスとテスト ケースのディレクトリにあるすべての構成を読み込みます。

void loadAndPrintAllConfigs ()

すべての構成をロード、解析、およびすべてのオプション値を設定できることを確認するユーティリティ メソッド。

void printHelp (PrintStream out)

このファクトリのヘルプ出力を表示します。

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

コマンド ライン引数で指定されたIConfigurationのヘルプ出力を出力します。

「args」が既知の構成を参照する場合、XML からIConfigurationオブジェクトが作成され、そのIConfigurationのヘルプが出力されます。

保護されたメソッド

InputStream getBundledConfigStream (String name)
String getConfigPrefix ()

クラスパス上の構成 xml ファイルのパス接頭辞を返します

公開されているため、単体テストをモックできます。

BufferedInputStream getConfigStream (String name)

指定された構成名の InputStream をロードします

ConfigurationDef getConfigurationDef (String name, boolean isGlobal, templateMap) getConfigurationDef (String name, boolean isGlobal, templateMap)

指定された名前のConfigurationDefを取得します

getMapConfig ()

テストのために公開。

boolean isDirectConfiguration (String configName)
String[] reorderArgs (String[] args)

template:map 引数がすべて前面に移動するように、引数を並べ替えます。

IRemoteFileResolver.ResolvedFile resolveRemoteFile (URI configURI, URI destDir)

保護されたコンストラクター

ConfigurationFactory

protected ConfigurationFactory ()

公開メソッド

clearMapConfig

public void clearMapConfig ()

特定のケースでは、マップをクリアする必要があります。

createConfigurationFromArgs

public IConfiguration createConfigurationFromArgs (String[] arrayArgs, 
                 unconsumedArgs)

コマンド ライン引数からIConfigurationを作成します。

予想される形式は「CONFIG [オプション]」です。ここで、CONFIG は、組み込みの構成名または構成 xml ファイルへのファイル パスです。

パラメーター
arrayArgs String : コマンドライン引数

unconsumedArgs : 指定された構成に関連付けられたオブジェクトによって消費されなかった引数が入力されるリスト。これがnullの場合、未処理の引数が残っている場合、実装はConfigurationExceptionをスローします。

戻り値
IConfigurationロードされたIConfiguration 。デリゲート オブジェクトのOptionフィールドには、args の値が入力されています。

スロー
ConfigurationException

createConfigurationFromArgs

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

キー ストアを使用して、コマンド ライン引数からIConfigurationを作成します。

予想される形式は「CONFIG [オプション]」です。ここで、CONFIG は、組み込みの構成名または構成 xml ファイルへのファイル パスです。

パラメーター
arrayArgs String : コマンドライン引数

unconsumedArgs : 指定された構成に関連付けられたオブジェクトによって消費されなかった引数が入力されるリスト。これがnullの場合、未処理の引数が残っている場合、実装はConfigurationExceptionをスローします。

keyStoreClient IKeyStoreClient : args で機密情報を取得するために使用されるIKeyStoreClient

戻り値
IConfigurationロードされたIConfiguration 。デリゲート オブジェクトのOptionフィールドには、args の値が入力されています。

スロー
ConfigurationException

createConfigurationFromArgs

public IConfiguration createConfigurationFromArgs (String[] arrayArgs)

nullの 2 番目の引数をERROR(/#createConfigurationFromArgs(String[],List))呼び出す便利なメソッド。したがって、未使用の引数が残っている場合はConfigurationExceptionがスローされます。

パラメーター
arrayArgs String

戻り値
IConfiguration

スロー
ConfigurationException

createGlobalConfigurationFromArgs

public IGlobalConfiguration createGlobalConfigurationFromArgs (String[] arrayArgs, 
                 remainingArgs)

コマンド ライン引数からIGlobalConfigurationを作成します。

予想される形式は「CONFIG [オプション]」です。ここで、CONFIG は、組み込みの構成名または構成 xml ファイルへのファイル パスです。

パラメーター
arrayArgs String : コマンドライン引数

remainingArgs : グローバル引数として処理されなかった引数が入力されるリスト

戻り値
IGlobalConfigurationロードされたIGlobalConfiguration 。デリゲート オブジェクトのOptionフィールドには、args の値が入力されています。

スロー
ConfigurationException

createPartialConfigurationFromArgs

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

選択したオブジェクトのセットのみを含む構成を作成します。

パラメーター
arrayArgs String : コマンドライン引数

keyStoreClient IKeyStoreClient : args で機密情報を取得するために使用されるIKeyStoreClient

allowedObjects : 作成できるオブジェクトのセット

delegator TradefedDelegator

戻り値
IConfiguration読み込まれたIConfiguration

スロー
ConfigurationException

dumpConfig

public void dumpConfig (String configName, 
                PrintStream out)

構成の内容を指定されたERROR(/PrintStream)にダンプします。

パラメーター
configName String : 構成名

out PrintStream : 出力をダンプするERROR(/PrintStream)

getConfigList

public  getConfigList (String subPath, 
                boolean loadFromEnv)

環境から構成をロードするかどうかを指定できるgetConfigList()のバリエーション。

パラメーター
subPath String : 構成を調べるサブディレクトリの名前。 null の場合、 getConfigList()と同じ動作になります。

loadFromEnv boolean : 環境変数に構成をロードする必要がある場合は true。

戻り値

getConfigList

public  getConfigList ()

クラスパスの JAR で見つかったすべての構成の名前のリストを返します。どの構成もロードしようとしないため、このリストに構成が機能していない可能性があります。

戻り値

getInstance

public static IConfigurationFactory getInstance ()

シングルトンIConfigurationFactoryインスタンスを取得します。

戻り値
IConfigurationFactory

loadAllConfigs

public void loadAllConfigs (boolean discardExceptions)

クラスパスとテスト ケースのディレクトリにあるすべての構成を読み込みます。

パラメーター
discardExceptions boolean : ConfigurationException を無視する必要がある場合は true。

スロー
com.android.tradefed.config.ConfigurationException
ConfigurationException

loadAndPrintAllConfigs

public void loadAndPrintAllConfigs ()

すべての構成をロード、解析、およびすべてのオプション値を設定できることを確認するユーティリティ メソッド。依存するプロジェクトが構成を検証できるようにのみ公開されます。コンソールで公開しないでください。

スロー
ConfigurationException 1 つ以上の設定の読み込みに失敗した場合

printHelp

public void printHelp (PrintStream out)

このファクトリのヘルプ出力を表示します。

一般的なヘルプ情報を出力し、利用可能なすべての構成を一覧表示します。

パラメーター
out PrintStream : 出力をダンプするERROR(/PrintStream)

printHelpForConfig

public 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)

保護されたメソッド

getBundledConfigStream

protected InputStream getBundledConfigStream (String name)

パラメーター
name String

戻り値
InputStream

getConfigPrefix

protected String getConfigPrefix ()

クラスパス上の構成 xml ファイルのパス接頭辞を返します

公開されているため、単体テストをモックできます。

戻り値
String末尾が / のERROR(/String)パス

getConfigStream

protected BufferedInputStream getConfigStream (String name)

指定された構成名の InputStream をロードします

パラメーター
name String : ロードする構成名

戻り値
BufferedInputStream構成コンテンツを読み取るためのERROR(/BufferedInputStream)

スロー
ConfigurationException設定が見つからなかった場合

getConfigurationDef

protected ConfigurationDef getConfigurationDef (String name, 
                boolean isGlobal, 
                 templateMap)

指定された名前のConfigurationDefを取得します

パラメーター
name String : ロードする組み込み構成の名前、またはロードする構成ファイルへのファイル パス

isGlobal boolean

templateMap

戻り値
ConfigurationDef ConfigurationDef

スロー
ConfigurationException構成の読み込み中にエラーが発生した場合

getMapConfig

protected  getMapConfig ()

テストのために公開。マップのコピーを返します。

戻り値

isDirectConfiguration

protected boolean isDirectConfiguration (String configName)

パラメーター
configName String

戻り値
boolean

reorderArgs

protected String[] reorderArgs (String[] args)

template:map 引数がすべて前面に移動するように、引数を並べ替えます。

パラメーター
args String

戻り値
String[]

resolveRemoteFile

protected IRemoteFileResolver.ResolvedFile resolveRemoteFile (URI configURI, 
                URI destDir)

パラメーター
configURI URI

destDir URI

戻り値
IRemoteFileResolver.ResolvedFile

スロー
BuildRetrievalError