1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.tradefed.config; 18 19 import java.util.Map; 20 21 /** 22 * Interface for retrieving a ConfigurationDef. 23 */ 24 interface IConfigDefLoader { 25 26 /** 27 * Retrieve the {@link ConfigurationDef} for the given name 28 * 29 * @param name 30 * @param templateMap map of template-include names to configuration filenames 31 * @return {@link ConfigurationDef} 32 * @throws ConfigurationException if an error occurred loading the config 33 */ getConfigurationDef(String name, Map<String, String> templateMap)34 ConfigurationDef getConfigurationDef(String name, Map<String, String> templateMap) 35 throws ConfigurationException; 36 isGlobalConfig()37 boolean isGlobalConfig(); 38 39 /** 40 * Load a config's data into the given {@link ConfigurationDef} 41 * 42 * @param def the {@link ConfigurationDef} to load the data into 43 * @param parentName the name of the parent config 44 * @param name the name of config to include 45 * @param deviceTagObject the name of the current deviceTag or null if not inside a device tag. 46 * @param templateMap the current map of template to be loaded. 47 * @throws ConfigurationException if an error occurred loading the config 48 */ loadIncludedConfiguration( ConfigurationDef def, String parentName, String name, String deviceTagObject, Map<String, String> templateMap)49 void loadIncludedConfiguration( 50 ConfigurationDef def, 51 String parentName, 52 String name, 53 String deviceTagObject, 54 Map<String, String> templateMap) 55 throws ConfigurationException; 56 } 57