ConfigurationFactory.ConfigLoader

protected class ConfigurationFactory.ConfigLoader
extends Object implements IConfigDefLoader

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


Implementation of IConfigDefLoader that tracks the included configurations from one root config, and throws an exception on circular includes.

Summary

Public constructors

ConfigurationFactory.ConfigLoader(boolean isGlobalConfig)

Public methods

ConfigurationDef getConfigurationDef(String name, Map<String, String> templateMap)

Retrieve the ConfigurationDef for the given name

boolean isGlobalConfig()

void loadIncludedConfiguration(ConfigurationDef def, String parentName, String name, String deviceTagObject, Map<String, String> templateMap)

Configs that are bundled inside the tradefed.jar can only include other configs also bundled inside tradefed.jar.

Protected methods

String findConfigName(String name, String parentName)

Find config's name based on its name and its parent name.

boolean isBundledConfig(String name)

Returns true if it is a config file found inside the classpath.

boolean isTrackableConfig(String name)

Should track the config's life cycle or not.

void trackConfig(String name, ConfigurationDef def)

Track config for dynamic loading.

Public constructors

ConfigurationFactory.ConfigLoader

public ConfigurationFactory.ConfigLoader (boolean isGlobalConfig)

Parameters
isGlobalConfig boolean

Public methods

getConfigurationDef

public ConfigurationDef getConfigurationDef (String name, 
                Map<String, String> templateMap)

Retrieve the ConfigurationDef for the given name

Parameters
templateMap Map: map of template-include names to configuration filenames

Returns
ConfigurationDef ConfigurationDef

Throws
ConfigurationException

isGlobalConfig

public boolean isGlobalConfig ()

Returns
boolean

loadIncludedConfiguration

public void loadIncludedConfiguration (ConfigurationDef def, 
                String parentName, 
                String name, 
                String deviceTagObject, 
                Map<String, String> templateMap)

Configs that are bundled inside the tradefed.jar can only include other configs also bundled inside tradefed.jar. However, local (external) configs can include both local (external) and bundled configs.

Parameters
def ConfigurationDef: the ConfigurationDef to load the data into

parentName String: the name of the parent config

name String: the name of config to include

deviceTagObject String: the name of the current deviceTag or null if not inside a device tag.

templateMap Map: the current map of template to be loaded.

Throws
ConfigurationException

Protected methods

findConfigName

protected String findConfigName (String name, 
                String parentName)

Find config's name based on its name and its parent name. This is used to properly handle bundle configs and local configs.

Parameters
name String: config's name

parentName String: config's parent's name.

Returns
String the config's full name.

Throws
ConfigurationException

isBundledConfig

protected boolean isBundledConfig (String name)

Returns true if it is a config file found inside the classpath.

Parameters
name String

Returns
boolean

isTrackableConfig

protected boolean isTrackableConfig (String name)

Should track the config's life cycle or not.

Parameters
name String: config's name

Returns
boolean true if the config is trackable, otherwise false.

trackConfig

protected void trackConfig (String name, 
                ConfigurationDef def)

Track config for dynamic loading. Right now only local files are supported.

Parameters
name String: config's name

def ConfigurationDef: config's def.