本文整理汇总了Java中org.apache.commons.configuration.MapConfiguration.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java MapConfiguration.addProperty方法的具体用法?Java MapConfiguration.addProperty怎么用?Java MapConfiguration.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.configuration.MapConfiguration
的用法示例。
在下文中一共展示了MapConfiguration.addProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractCodahaleFixtureGenerator
import org.apache.commons.configuration.MapConfiguration; //导入方法依赖的package包/类
public AbstractCodahaleFixtureGenerator(String[] args,
Options options) throws Exception {
Preconditions.checkNotNull(args);
Preconditions.checkNotNull(options);
CommandLineParser parser = new DefaultParser();
try {
CommandLine cmdLine = parser.parse(options, args);
if (!cmdLine.getArgList().isEmpty()) {
throw new ParseException("Unexpected extra arguments: " +
cmdLine.getArgList());
}
config = new MapConfiguration(Maps.<String, Object>newHashMap());
for (Option option : cmdLine.getOptions()) {
config.addProperty(option.getLongOpt(), option.getValue());
}
} catch (ParseException ex) {
IOUtils.write("Error: " + ex.getMessage() + "\n", System.err);
printUsageMessage(System.err, options);
throw ex;
}
}
示例2: configure
import org.apache.commons.configuration.MapConfiguration; //导入方法依赖的package包/类
@BeforeClass
public static void configure() {
// Storm sink configuration
stormSinkConfig = new MapConfiguration(new HashMap<String, Object>());
stormSinkConfig.addProperty(StormSinkConfiguration.LOCATION_SERVICE_FACTORY_CLASS,
SimpleLocationServiceFactory.class.getName());
stormSinkConfig.addProperty(StormSinkConfiguration.SERVICE_PROVIDER_SERIALIZATION_CLASS,
SimpleServiceProviderSerialization.class.getName());
stormSinkConfig.addProperty(StormSinkConfiguration.EVENT_SENDER_FACTORY_CLASS,
SimpleEventSenderFactory.class.getName());
stormSinkConfig.addProperty(StormSinkConfiguration.CONNECTION_PARAMETERS_FACTORY_CLASS,
SimpleConnectionParametersFactory.class.getName());
}