org.apache.avalon.framework.configuration.Configuration.getValueAsInteger()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.apache.avalon.framework.configuration.Configuration.getValueAsInteger()方法的一些代码示例,展示了Configuration.getValueAsInteger()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getValueAsInteger()方法的具体详情如下:
包路径:org.apache.avalon.framework.configuration.Configuration
类名称:Configuration
方法名:getValueAsInteger

Configuration.getValueAsInteger介绍

[英]Return the int value of the node.
[中]返回节点的int值。

代码示例

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger

/**
 * Helper method to obtain the maximum delay time any particular SMTP
 * message can be queued from a given configuration object.
 *
 * @param config a <code>Configuration</code> instance
 * @return maximum SMTP mail delay time
 */
private int getMaxDelayTime( Configuration config )
  throws ConfigurationException
{
  return config.getChild( "maximum-delay-time" ).getValueAsInteger( 0 );
}

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger

/**
 * Helper method to obtain the maximum size any particular SMTP
 * message can be from a given configuration object.
 *
 * @param config a <code>Configuration</code> instance
 * @return maximum SMTP mail size
 */
private int getMaxSize( Configuration config )
  throws ConfigurationException
{
  return config.getChild( "maximum-size" ).getValueAsInteger( 1 );
}

代码示例来源:origin: org.apache.fulcrum/fulcrum-pool

int capacity = defaultConf.getValueAsInteger(DEFAULT_POOL_CAPACITY);
if (capacity <= 0) 
  if (!"default".equals(key)) 
    capacity = nameVal[i].getValueAsInteger(poolCapacity);
    if (capacity < 0)

代码示例来源:origin: org.apache.avalon.cornerstone.scheduler/cornerstone-scheduler-api

conf.getChild( "offset", true ).getValueAsInteger( 0 );
final int period =
  conf.getChild( "period", true ).getValueAsInteger( -1 );
  conf.getChild( "minute" ).getValueAsInteger( -1 );
final int hour =
  conf.getChild( "hour" ).getValueAsInteger( -1 );
final int day =
  conf.getChild( "day" ).getValueAsInteger( -1 );
final int month =
  conf.getChild( "month" ).getValueAsInteger( -1 );
final int year =
  conf.getChild( "year" ).getValueAsInteger( -1 );
final boolean dayOfWeek =
  conf.getChild( "day" ).getAttributeAsBoolean( "week", false );

代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException {
  super.configure(configuration);
  this.maxArgLength = configuration.getChild("maxArgLength").getValueAsInteger(MAX_ARG_LENGTH);
  this.toStringBuilderClassName = configuration.getChild("toStringBuilderClass")
      .getValue(ArgumentToStringBuilderImpl.class.getName());
  this.monitorAllExceptions = configuration.getChild("monitorAllExceptions").getValueAsBoolean(true);
}

代码示例来源:origin: org.apache.turbine/fulcrum-yaafi

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException
{
  super.configure(configuration);
  this.maxArgLength = configuration.getChild("maxArgLength").getValueAsInteger(MAX_ARG_LENGTH);
  this.toStringBuilderClassName = configuration.getChild("toStringBuilderClass").getValue(ArgumentToStringBuilderImpl.class.getName());
  this.monitorAllExceptions = configuration.getChild("monitorAllExceptions").getValueAsBoolean(true);
}

代码示例来源:origin: org.codehaus.plexus/plexus-ftpd

tmpConf = conf.getChild("ftp-port", false);
if(tmpConf != null) {
  miServerPort = tmpConf.getValueAsInteger(miServerPort);
tmpConf = conf.getChild("max-connection", false);
if(tmpConf != null) {
  miMaxLogin = tmpConf.getValueAsInteger(miMaxLogin);
tmpConf = conf.getChild("anonymous-max-connection", false);
if(tmpConf != null) {
  miAnonLogin = tmpConf.getValueAsInteger(miAnonLogin);
tmpConf = conf.getChild("poll-interval", false);
if(tmpConf != null) {
  miPollInterval = tmpConf.getValueAsInteger(miPollInterval);
tmpConf = conf.getChild("remote-admin-port", false);
if(tmpConf != null) {
  miRmiPort = tmpConf.getValueAsInteger(miRmiPort);
tmpConf = conf.getChild("default-idle-time", false);
if(tmpConf != null) {
  miDefaultIdle = tmpConf.getValueAsInteger(miDefaultIdle);

代码示例来源:origin: com.whirlycott/whirlycache

/**
* Configure the cache using a Configuration object.
*/
public void configure(final Configuration configuration) throws ConfigurationException {
  final Configuration backend = configuration.getChild(Constants.CONFIG_BACKEND);
  final Configuration policy = configuration.getChild(Constants.CONFIG_POLICY);
  cacheConfiguration = new CacheConfiguration();
  cacheConfiguration.setName(configuration.getChild(Constants.CONFIG_NAME).getValue(toString()));
  cacheConfiguration.setBackend(backend.getValue());
  cacheConfiguration.setMaxSize(configuration.getChild(Constants.CONFIG_MAXSIZE).getValueAsInteger());
  cacheConfiguration.setPolicy(policy.getValue());
  cacheConfiguration.setTunerSleepTime(configuration.getChild(Constants.CONFIG_TUNER_SLEEPTIME).getValueAsInteger());
  managedCacheClass = loadManagedCacheClass(backend.getLocation());
  cacheMaintenancePolicyClass = loadCacheMaintenancePolicyClass(policy.getLocation());
}

代码示例来源:origin: net.sf.barcode4j/barcode4j

child = cfg.getChild("min-columns", false);
if (child != null) {
  getPDF417Bean().setMinCols(child.getValueAsInteger());
  getPDF417Bean().setMaxCols(child.getValueAsInteger());
  getPDF417Bean().setMinRows(child.getValueAsInteger());
  getPDF417Bean().setMaxRows(child.getValueAsInteger());
  getPDF417Bean().setColumns(child.getValueAsInteger());
getPDF417Bean().setErrorCorrectionLevel(cfg.getChild("ec-level").getValueAsInteger(
    PDF417Bean.DEFAULT_ERROR_CORRECTION_LEVEL));

代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException {
  super.configure(configuration);
  this.maxArgLength = configuration.getChild("maxArgLength").getValueAsInteger(MAX_ARG_LENGTH);
  Configuration tresholdConfiguration = configuration.getChild("tresholds");
  this.tresholdList[0] = tresholdConfiguration.getChild("fatal").getAttributeAsInteger("millis", 5000);
  this.tresholdList[1] = tresholdConfiguration.getChild("error").getAttributeAsInteger("millis", 1000);
  this.tresholdList[2] = tresholdConfiguration.getChild("warn").getAttributeAsInteger("millis", 500);
  this.tresholdList[3] = tresholdConfiguration.getChild("info").getAttributeAsInteger("millis", 100);
  this.tresholdList[4] = tresholdConfiguration.getChild("debug").getAttributeAsInteger("millis", 10);
}

代码示例来源:origin: org.apache.turbine/fulcrum-yaafi

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException
{
  super.configure(configuration);
  this.maxArgLength = configuration.getChild("maxArgLength").getValueAsInteger(MAX_ARG_LENGTH);
  Configuration tresholdConfiguration = configuration.getChild("tresholds");
  this.tresholdList[0] = tresholdConfiguration.getChild("fatal").getAttributeAsInteger("millis", 5000);
  this.tresholdList[1] = tresholdConfiguration.getChild("error").getAttributeAsInteger("millis", 1000);
  this.tresholdList[2] = tresholdConfiguration.getChild("warn").getAttributeAsInteger("millis", 500);
  this.tresholdList[3] = tresholdConfiguration.getChild("info").getAttributeAsInteger("millis", 100);
  this.tresholdList[4] = tresholdConfiguration.getChild("debug").getAttributeAsInteger("millis", 10);
}

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

configuration.getChild( "max-leased-samples" ).getValueAsInteger( 256 );
m_maxLeasedSampleSize =
  configuration.getChild( "max-leased-sample-size" ).getValueAsInteger( 2048 );
m_maxLeasedSampleLease = 1000L *
  configuration.getChild( "max-leased-sample-lease" ).getValueAsInteger( 86400 );

代码示例来源:origin: org.apache.cocoon/cocoon-core

/**
 * Avalon Configurable Interface
 */
public void configure(Configuration config) throws ConfigurationException {
  super.configure(config);
  this.defaultInputConf = config.getChild("input-module");
  this.defaultInput = this.defaultInputConf.getAttribute("name", this.defaultInput);
  this.separator = config.getChild("separator").getValue(this.separator);
  this.defaultPrefix = config.getChild("prefix").getValue(this.defaultPrefix);
  this.defaultSuffix = config.getChild("suffix").getValue(this.defaultSuffix);
  this.fixedName = config.getChild("fixed-attribute").getValue(this.fixedName);
  this.useFormName = config.getChild("use-form-name").getValueAsBoolean(this.useFormName);
  this.useFormNameTwice =
    config.getChild("use-form-name-twice").getValueAsBoolean(this.useFormNameTwice);
  this.useFormName = this.useFormName || this.useFormNameTwice;
  if (this.useFormName) {
    this.separator =
      (this.separator == null || this.separator.equals("") ? "/" : this.separator);
    this.defaultPrefix = this.separator;
  }
  this.ignoreValidation =
    config.getChild("ignore-validation").getValueAsBoolean(this.ignoreValidation);
  this.decorationSize = config.getChild("decoration").getValueAsInteger(this.decorationSize);
  this.stripNumber = config.getChild("strip-number").getValueAsBoolean(this.stripNumber);
}

代码示例来源:origin: org.apache.cocoon/cocoon-pipeline-components

/**
 * Read reader configuration
 *
 * @deprecated use property injection instead
 */
public void configure(Configuration configuration) throws ConfigurationException {
  // VG Parameters are deprecated as of 2.2.0-Dev/2.1.6-Dev
  final Parameters parameters = Parameters.fromConfiguration(configuration);
  this.setExpires(parameters.getParameterAsLong("expires", CONFIGURED_EXPIRES_DEFAULT));
  this.setQuickTest(parameters.getParameterAsBoolean("quick-modified-test", CONFIGURED_QUICK_TEST_DEFAULT));
  this.setBufferSize(parameters.getParameterAsInteger("buffer-size", CONFIGURED_BUFFER_SIZE_DEFAULT));
  this.setByteRanges(parameters.getParameterAsBoolean("byte-ranges", CONFIGURED_BYTE_RANGES_DEFAULT));
  // Configuration has precedence over parameters.
  setExpires(configuration.getChild("expires").getValueAsLong(configuredExpires));
  setQuickTest(configuration.getChild("quick-modified-test").getValueAsBoolean(configuredQuickTest));
  setBufferSize(configuration.getChild("buffer-size").getValueAsInteger(configuredBufferSize));
  setByteRanges(configuration.getChild("byte-ranges").getValueAsBoolean(configuredByteRanges));
}

代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi

.getValueAsInteger(RECONFIGURATION_DELAY_DEFAULT);
this.disposalDelay = configuration.getChild(DISPOSAL_DELAY_KEY).getValueAsInteger(DISPOSAL_DELAY_DEFAULT);

代码示例来源:origin: org.apache.turbine/fulcrum-yaafi

configuration.getChild(RECONFIGURATION_DELAY_KEY).getValueAsInteger(
    RECONFIGURATION_DELAY_DEFAULT
  );
  configuration.getChild(DISPOSAL_DELAY_KEY).getValueAsInteger(
      DISPOSAL_DELAY_DEFAULT
  );

相关文章