Creates the Hierarchy using the information into the Config

@param context The Context
@param config  The Config object
@return The Hierarchy to use
542826
public static GenericDraweeHierarchy createDraweeHierarchy(
          final Context context,
          final Config config) {
    FrescoSystrace.beginSection("DraweeUtil#createDraweeHierarchy");
    GenericDraweeHierarchyBuilder builder =
            new GenericDraweeHierarchyBuilder(context.getResources())
            .setFadeDuration(config.fadeDurationMs)
            .setPlaceholderImage(Const.PLACEHOLDER)
            .setFailureImage(Const.FAILURE)
            .setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    applyScaleType(builder, config);

    if (config.useRoundedCorners || config.drawBorder) {
      final Resources res = context.getResources();
      final RoundingParams roundingParams = new RoundingParams();

      if (config.useRoundedCorners) {
        roundingParams.setRoundingMethod(RoundingParams.RoundingMethod.BITMAP_ONLY);
        roundingParams.setCornersRadius(res.getDimensionPixelSize(R.dimen.drawee_corner_radius));
        roundingParams.setRoundAsCircle(config.useRoundedAsCircle);
      }

      if (config.drawBorder) {
        //noinspection deprecation
        roundingParams.setBorderColor(res.getColor(R.color.colorPrimary));
        roundingParams.setBorderWidth(res.getDimensionPixelSize(R.dimen.drawee_border_width));
      }

      builder.setRoundingParams(roundingParams);
    }
    GenericDraweeHierarchy result = builder.build();
    FrescoSystrace.endSection();
    return result;
  }
582795
private GroupMetadata findGroup(GroupHierarchyConfig config, String parentGroupId) {
        GroupMetadata parentGroup = findByRef(Group.refById(parentGroupId));

        return parentGroup.getGroups().stream()
            .filter(group -> group.getName().equals(config.getName()))
            .findFirst()
            .orElse(null);
    }
962753
private function doConfigure(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
		if (isset($config['threshold'])) {
			$threshold = \n2n\log4php\LoggerLevel::toLevel($config['threshold']);
			if (isset($threshold)) {
				$hierarchy->setThreshold($threshold);
			} else {
				$this->warn("Invalid threshold value [{$config['threshold']}] specified. Ignoring threshold definition.");
			}
		}
		
		// Configure appenders and add them to the appender pool
		if (isset($config['appenders']) && is_array($config['appenders'])) {
			foreach($config['appenders'] as $name => $appenderConfig) {
				$this->configureAppender($name, $appenderConfig);
			}
		}
		
		// Configure root logger 
		if (isset($config['rootLogger'])) {
			$this->configureRootLogger($hierarchy, $config['rootLogger']);
		}
		
		// Configure loggers
		if (isset($config['loggers']) && is_array($config['loggers'])) {
			foreach($config['loggers'] as $loggerName => $loggerConfig) {
				$this->configureOtherLogger($hierarchy, $loggerName, $loggerConfig);
			}
		}

		// Configure renderers
		if (isset($config['renderers']) && is_array($config['renderers'])) {
			foreach($config['renderers'] as $rendererConfig) {
				$this->configureRenderer($hierarchy, $rendererConfig);
			}
		}
		
		if (isset($config['defaultRenderer'])) {
			$this->configureDefaultRenderer($hierarchy, $config['defaultRenderer']);
		}
	}
831617
private synchronized void addContext(final EvaluatorContext context) {
    this.contextStack.add(context);
    this.contextIds.add(context.getId());
  }
1285054
private static GroupTemplate createEngine(TemplateConfig config) {
		if (null == config) {
			config = new TemplateConfig();
		}

		switch (config.getResourceMode()) {
		case CLASSPATH:
			return createGroupTemplate(new ClasspathResourceLoader(config.getPath(), config.getCharsetStr()));
		case FILE:
			return createGroupTemplate(new FileResourceLoader(config.getPath(), config.getCharsetStr()));
		case WEB_ROOT:
			return createGroupTemplate(new WebAppResourceLoader(config.getPath(), config.getCharsetStr()));
		case STRING:
			return createGroupTemplate(new StringTemplateResourceLoader());
		case COMPOSITE:
			//TODO 需要定义复合资源加载器
			return createGroupTemplate(new CompositeResourceLoader());
		default:
			return new GroupTemplate();
		}
	}
96038
public synchronized static void initConfig(ITestContext context) {
        SeLionLogger.getLogger().entering(context);
        Map<ConfigProperty, String> initialValues = new HashMap<>();
        Map<String, String> testParams = context.getCurrentXmlTest().getLocalParameters();
        if (!testParams.isEmpty()) {
            for (ConfigProperty prop : ConfigProperty.values()) {
                // Check if a selionConfig param resides in the <test>
                String newValue = testParams.get(prop.getName());
                // accept param values that are empty in initialValues.
                if (newValue != null) {
                    initialValues.put(prop, newValue);
                }
            }
        }

        ConfigManager.addConfig(context.getCurrentXmlTest().getName(), new LocalConfig(initialValues));
        SeLionLogger.getLogger().exiting();
    }
1358392
protected Map<String, Map<String, String>> createStepItemDataContext(final Framework framework,
                                                                         final String project,
                                                                         final Map<String, Map<String, String>> context,
                                                                         final Map<String, Object> configuration) {

        final Map<String, Map<String, String>> localDataContext = createScriptDataContext(framework, project, context);

        final HashMap<String, String> configMap = new HashMap<String, String>();
        //convert values to string
        for (final Map.Entry<String, Object> entry : configuration.entrySet()) {
            configMap.put(entry.getKey(), entry.getValue().toString());
        }
        localDataContext.put("config", configMap);
        return localDataContext;
    }
111585
public static AuthInfo getUserAuthInfo(Config config, Context context) {
    AuthInfo authInfo = null;
    if (config != null && context != null) {
      String user = context.getUser();
      if (user != null) {
        List<NamedAuthInfo> users = config.getUsers();
        if (users != null) {
          for (NamedAuthInfo namedAuthInfo : users) {
            if (user.equals(namedAuthInfo.getName())) {
              authInfo = namedAuthInfo.getUser();
            }
          }
        }
      }
    }
    return authInfo;
  }
385252
function Builder (config) {
  if (!(config instanceof Config)) {
    config = new Config(config)
  }
  this.config = config
  // TODO: check for root.val
  if (!this.config.native.root) {
    // TODO: simplify this set
    this.config.native.set({
      root: {
        val: process.cwd()
      }
    })
  }
}
169784
@Override
	public Context create(String name, Tree params, CallOptions.Options opts, PacketStream stream, Context parent) {

		// Generate ID
		String id = uid.nextUID();

		// Create new Context
		if (parent == null) {
			return new Context(serviceInvoker, eventbus, id, name, params, opts, stream);
		}

		// Merge meta block
		if (parent.params != null) {
			Tree parentMeta = parent.params.getMeta(false);
			if (parentMeta != null && !parentMeta.isEmpty()) {
				Tree currentMeta = params.getMeta(true);
				if (currentMeta.isEmpty()) {
					currentMeta.setObject(parentMeta.asObject());
				} else {
					currentMeta.copyFrom(parentMeta, false);
				}
			}
		}

		// Verify call level
		if (maxCallLevel > 0 && parent.level >= maxCallLevel) {
			throw new MaxCallLevelError(broker.getNodeID(), maxCallLevel);
		}

		// Create context (nested call)
		return new Context(id, name, params, opts, stream, parent);
	}
695723
public B importContext(AbstractContext context){
        Objects.requireNonNull(context);
        return importContext(context, false);
    }
103556
private static InstanceContext parseContext(JsonObject config) {
    JsonObject context = config.getObject("__context__");
    if (context == null) {
      throw new IllegalArgumentException("No component context found.");
    }
    config.removeField("__context__");
    return Contexts.deserialize(context);
  }
445151
private function configureRootLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
		$logger = $hierarchy->getRootLogger();
		$this->configureLogger($logger, $config);
	}
190104
public static JndiConfigurationSource create(Context context) {
    if (context == null) {
      throw new NullPointerException("context: null");
    }
    return new JndiConfigurationSource(createJndiConfiguration(context, null), DEFAULT_PRIORITY);
  }
606965
public static Context getContext() {
        Context context = LOCAL.get();
        if (context == null) {
            context = new Context(null, null);
            LOCAL.set(context);
        }
        return context;
    }
266041
public static Config setContextFilterClass(Config config, Class<? extends ContextFilter> klazz) {
    return config.withValue(CONTEXT_FILTER_CLASS, ConfigValueFactory.fromAnyRef(klazz.getCanonicalName()));
  }
1243730
private void addPropertiesFromFile(final SystemProperties config, final ServletContext context) {
        String fileLocation = StringUtils.replaceVariables(config.getFile(), new HashMap<String, Object>(), true);
        InputStream inStream = null;
        try {
            inStream = getStreamForLocation(fileLocation, context);
            Properties propsFromFile = new Properties();
            propsFromFile.load(inStream);
            for (String prop : propsFromFile.stringPropertyNames()) {
                String propertyValue = propsFromFile.getProperty(prop);
                if (propertyValue != null && (config.isOverrideProperties() || (System.getProperty(prop) == null))) {
                    System.setProperty(prop, propertyValue);
                }
            }
        } catch (FileNotFoundException e) {
            if (!config.isIgnoreMissingFile()) { 
                throw new IllegalStateException("Could not find properties file: " + fileLocation, e);
            }
        } catch (IOException e) {
            if (!config.isIgnoreMissingFile()) { 
                throw new IllegalStateException("Error occurred when reading properties file: " + fileLocation, e);
            }
        } finally {
            if (inStream != null) {
                try {
                    inStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }