本文整理汇总了Java中com.typesafe.config.ConfigFactory.parseMap方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigFactory.parseMap方法的具体用法?Java ConfigFactory.parseMap怎么用?Java ConfigFactory.parseMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.typesafe.config.ConfigFactory
的用法示例。
在下文中一共展示了ConfigFactory.parseMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
String dbCredsFile = System.getProperty("dbCredsFile");
if (StringUtils.isEmpty(dbCredsFile)) {
dbCredsFile = "postgresql-creds.properties";
}
return new ParamReader(
ConfigFactory.parseResources(dbCredsFile),
"postgresql",
ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "POSTGRESQL",
"logicalSchemas.schema1", "schema1",
"logicalSchemas.schema2", "schema2"
))
);
}
示例2: buildConfig
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
private Config buildConfig(String sRegex, String pRegex, String oRegex) {
return ConfigFactory.parseMap(new HashMap() {{
Map<String, Object> innerMap = new HashMap() {{
put("s", sRegex != null ? Collections.singleton(sRegex) : null);
put("p", pRegex != null ? Collections.singleton(pRegex) : null);
put("o", oRegex != null ? Collections.singleton(oRegex) : null);
}};
put(RegExFilterProcessor.name, innerMap);
}});
}
示例3: configure
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@Override
public void configure(Context context) {
String morphlineFile = context.getString(MORPHLINE_FILE_PARAM);
String morphlineId = context.getString(MORPHLINE_ID_PARAM);
if (morphlineFile == null || morphlineFile.trim().length() == 0) {
throw new MorphlineCompilationException("Missing parameter: " + MORPHLINE_FILE_PARAM, null);
}
morphlineFileAndId = morphlineFile + "@" + morphlineId;
if (morphlineContext == null) {
FaultTolerance faultTolerance = new FaultTolerance(
context.getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false),
context.getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
context.getString(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES));
morphlineContext = new MorphlineContext.Builder()
.setExceptionHandler(faultTolerance)
.setMetricRegistry(SharedMetricRegistries.getOrCreate(morphlineFileAndId))
.build();
}
Config override = ConfigFactory.parseMap(
context.getSubProperties(MORPHLINE_VARIABLE_PARAM + "."));
morphline = new Compiler().compile(
new File(morphlineFile), morphlineId, morphlineContext, finalChild, override);
this.mappingTimer = morphlineContext.getMetricRegistry().timer(
MetricRegistry.name("morphline.app", Metrics.ELAPSED_TIME));
this.numRecords = morphlineContext.getMetricRegistry().meter(
MetricRegistry.name("morphline.app", Metrics.NUM_RECORDS));
this.numFailedRecords = morphlineContext.getMetricRegistry().meter(
MetricRegistry.name("morphline.app", "numFailedRecords"));
this.numExceptionRecords = morphlineContext.getMetricRegistry().meter(
MetricRegistry.name("morphline.app", "numExceptionRecords"));
}
示例4: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
String dbCredsFile = System.getProperty("dbCredsFile");
if (StringUtils.isEmpty(dbCredsFile)) {
dbCredsFile = "mssql-creds.properties";
}
return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
"mssql", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "MSSQL",
"logicalSchemas.schema1", "oats"
))
);
}
示例5: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
return new ParamReader(ConfigFactory.parseResources("db2-creds.properties"), "db2", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "DB2",
"sysattrs.autoReorgEnabled", "true",
"sysattrs.metadataLineReaderVersion", "3",
"logicalSchemas.schema1", "DEPLOY_TRACKER"
)));
}
示例6: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
String dbCredsFile = System.getProperty("dbCredsFile");
if (StringUtils.isEmpty(dbCredsFile)) {
dbCredsFile = "oracle-creds.properties";
}
return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
"oracle", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "ORACLE",
"logicalSchemas.schema1", "schema1",
"logicalSchemas.schema2", "schema2"
))
);
}
示例7: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
String dbCredsFile = System.getProperty("dbCredsFile");
if (StringUtils.isEmpty(dbCredsFile)) {
dbCredsFile = "sybasease-creds.properties";
}
return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
"sybasease", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "SYBASE_ASE",
"logicalSchemas.schema1", "oats"
))
);
}
示例8: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
return new ParamReader(ConfigFactory.parseResources("h2-creds.properties"),
"h2", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "H2",
"logicalSchemas.schema1", "SCHEMA1",
"logicalSchemas.schema2", "SCHEMA2"
))
);
}
示例9: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
return new ParamReader(ConfigFactory.parseResources("sybaseiq-creds.properties"),
"sybaseiq", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "SYBASE_IQ",
"logicalSchemas.schema1", "deploytest01"
))
);
}
示例10: getParamReader
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
return new ParamReader(ConfigFactory.parseResources("hsql-creds.properties"),
"hsql", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
"sysattrs.type", "HSQL",
"logicalSchemas.schema1", "SCHEMA1",
"logicalSchemas.schema2", "SCHEMA2"
))
);
}
示例11: merge
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
protected Config merge() {
Config config = ConfigFactory.parseMap(configHolder);
if (fallback != null) {
config = config.withFallback(fallback);
}
return config;
}
示例12: toConfig
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public Config toConfig() {
Map<String, Object> propertiesMap = new HashMap<>();
propertiesMap.put(SERVER_HOST, host);
propertiesMap.put(SERVER_PORT, port);
return ConfigFactory.parseMap(propertiesMap);
}
示例13: buildConfig
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
private Config buildConfig(List<String> strPatterns) {
return ConfigFactory.parseMap(new HashMap() {{
put(StopPropertyFilterProcessor.name, strPatterns);
}});
}
示例14: getHostNameReturnsHostNameIfHostNameOverridden
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@Test
public void getHostNameReturnsHostNameIfHostNameOverridden() {
final Config config = ConfigFactory.parseMap(Collections.singletonMap("host-name", "foobar.example.net"));
final CollectorHostNameConfiguration hostNameConfiguration = new CollectorHostNameConfiguration(config);
assertEquals("foobar.example.net", hostNameConfiguration.getHostName());
}
示例15: overrideParams
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
/**
* Puts a new config atop of existing stack making the options
* in the supplied config overriding existing options
* Once put this config can't be removed
*
* @param cliOptions - command line options to take presidency
*/
public void overrideParams(Map<String, ? extends Object> cliOptions) {
Config cliConf = ConfigFactory.parseMap(cliOptions);
overrideParams(cliConf);
}