to top
public class

ConfigurationFactory

extends Object
implements IConfigurationFactory
java.lang.Object
   ↳ com.android.tradefed.config.ConfigurationFactory

Class Overview

Factory for creating IConfiguration.

Summary

Nested Classes
class ConfigurationFactory.ConfigLoader Implementation of IConfigDefLoader that tracks the included configurations from one root config, and throws an exception on circular includes. 
Public Methods
IConfiguration createConfigurationFromArgs(String[] arrayArgs)
Create the IConfiguration from command line arguments.
IGlobalConfiguration createGlobalConfigurationFromArgs(String[] arrayArgs, List<String> remainingArgs)
Create a IGlobalConfiguration from command line arguments.
void dumpConfig(String configName, PrintStream out)
Dumps the contents of the configuration to the given PrintStream
static IConfigurationFactory getInstance()
Get the singleton IConfigurationFactory instance.
void printHelp(PrintStream out)
Prints help output for this factory.
void printHelpForConfig(String[] args, boolean importantOnly, PrintStream out)
Prints help output for the IConfiguration specified in command line arguments,

If 'args' refers to a known configuration, a IConfiguration object will be created from XML, and help for that IConfiguration will be outputted.

[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.config.IConfigurationFactory

Public Methods

public IConfiguration createConfigurationFromArgs (String[] arrayArgs)

Create the IConfiguration from command line arguments.

Expected format is "CONFIG [options]", where CONFIG is the built-in configuration name or a file path to a configuration xml file.

Parameters
arrayArgs the command line arguments
Returns
  • the loaded IConfiguration. The delegate object Option fields have been populated with values in args.

public IGlobalConfiguration createGlobalConfigurationFromArgs (String[] arrayArgs, List<String> remainingArgs)

Create a IGlobalConfiguration from command line arguments.

Expected format is "CONFIG [options]", where CONFIG is the built-in configuration name or a file path to a configuration xml file.

Parameters
arrayArgs the command line arguments
remainingArgs a list which will be populated with the arguments that weren't processed as global arguments
Returns

public void dumpConfig (String configName, PrintStream out)

Dumps the contents of the configuration to the given PrintStream

Parameters
configName the configuration name
out the PrintStream to dump output to

public static IConfigurationFactory getInstance ()

Get the singleton IConfigurationFactory instance.

public void printHelp (PrintStream out)

Prints help output for this factory.

Prints a generic help info, and lists all available configurations.

Parameters
out the PrintStream to dump output to

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

Prints help output for the IConfiguration specified in command line arguments,

If 'args' refers to a known configuration, a IConfiguration object will be created from XML, and help for that IConfiguration will be outputted. Note all other 'args' values will be ignored (ie the help text will describe the current values of Options as loaded from XML, and will not reflect option's values set by the command line args.

If 'args' does not reference a known IConfiguration, the generic printHelp(PrintStream) help will be displayed.

Parameters
args the command line arguments
importantOnly if true, print an abbreviated help listing only the important details
out the PrintStream to dump output to