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

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

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

Configuration.getValueAsBoolean介绍

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

代码示例

代码示例来源:origin: plutext/docx4j

try {
  fontManager.setUseCache(
      cfg.getChild("use-cache").getValueAsBoolean());
} catch (ConfigurationException mfue) {
  LogUtil.handleException(log, mfue, true);

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

/**
 * Helper method to obtain the debug glag to use from the given
 * configuration object.
 *
 * @param config a <code>Configuration</code> instance
 * @return subject line
 */
private boolean getDebug( Configuration config )
  throws ConfigurationException
{
  return config.getChild( "debug" ).getValueAsBoolean();
}

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

public void configure(Configuration configuration) throws ConfigurationException {
  /* Read configuration nodes for recursive, parallel, recursive-parallel */
  this.defaultRecursive = configuration.getChild("recursive").getValueAsBoolean(false);
  this.defaultParallel = configuration.getChild("parallel").getValueAsBoolean(false);
  this.defaultRecursiveParallel = configuration.getChild("recursive-parallel").getValueAsBoolean(false);
  /* Read configuration node for thread pool name */
  this.threadPool = configuration.getChild("thread-pool").getValue("default");
  this.defaultKey = configuration.getChild("key").getValue(null);
}

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

/**
 * Set configuration
 */
public void configure(Configuration conf) throws ConfigurationException {
  super.configure(conf);
  mbEncrypt = conf.getChild("encrypt").getValueAsBoolean(false);
  try {
    mUserDataFile = new File(getBaseDirectory(), USER_PROP);
    mUserDataFile.createNewFile();
    mUserData = new BaseProperties(mUserDataFile);
    mlLastModified = mUserDataFile.lastModified();
    getLogger().info("Loaded user data file - " + mUserDataFile);
  }
  catch(IOException ex) {
    getLogger().error(ex.getMessage(), ex);
    throw new ConfigurationException(ex.getMessage());
  }
}

代码示例来源: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

/**
 * Configure user manager - third step.
 */
public void configure(Configuration config) throws ConfigurationException {
  mConfig = config;
  // get server address
  Configuration tmpConf = mConfig.getChild("allow-ip", false);
  mbAllowIp = false;
  if(tmpConf != null) {
    mbAllowIp = tmpConf.getValueAsBoolean(mbAllowIp);
  }
  mBaseDirectory = config.getChild("base-directory").getValue(null);
  if(mBaseDirectory == null)
    throw new ConfigurationException("Missing configuration element 'base-directory'");
}

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

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration config) throws ConfigurationException {
  this.reloadScripts = config.getChild("reload-scripts").getValueAsBoolean(this.settings.isReloadingEnabled("flow"));
  this.checkTime = config.getChild("check-time").getValueAsLong(this.settings.getReloadDelay("flow"));
}

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

/**
 * Create root jxpath configuration
 */
public JXPathHelperConfiguration(Configuration config)
throws ConfigurationException {
  this.lenient = config.getChild("lenient").getValueAsBoolean(true);
  this.library = new FunctionLibrary();
  setup(config);
  // the following is necessary to be able to use methods on objects without
  // explicitely registering extension functions (see PackageFunctions javadoc)
  this.library.addFunctions(new PackageFunctions("", null));
}

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

/**
 * Avalon component lifecycle method
 */
public void configure(Configuration conf) throws ConfigurationException
{
  String foldString = conf.getChild(URL_CASE_FOLDING_KEY).getValue(URLCaseFolding.NONE.name()).toLowerCase();
  folding = URLCaseFolding.NONE;
  getLogger().debug("Setting folding from " + foldString);
  if (StringUtils.isNotEmpty(foldString))
  {
    try
    {
      folding = URLCaseFolding.valueOf(foldString.toUpperCase());
    }
    catch (IllegalArgumentException e)
    {
      getLogger().error("Got " + foldString + " from " + URL_CASE_FOLDING_KEY + " property, which is illegal!");
      throw new ConfigurationException("Value " + foldString + " is illegal!", e);
    }
  }
  parameterEncoding = conf.getChild(PARAMETER_ENCODING_KEY)
            .getValue(PARAMETER_ENCODING_DEFAULT).toLowerCase();
  automaticUpload = conf.getChild(AUTOMATIC_KEY).getValueAsBoolean(AUTOMATIC_DEFAULT);
}

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

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException {
  super.configure(configuration);
  this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0);
  // parse the performance monitor class name
  this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName")
      .getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME);
  // parse the report file name
  String reportFileName = configuration.getChild("reportFile").getValue("./javasimon.html");
  this.reportFile = this.makeAbsoluteFile(reportFileName);
  // determine when to create the next report
  this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout;
  // do we create a report on disposal
  this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false);
}

代码示例来源: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.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0);
  // parse the performance monitor class name
  this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName").getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME);
  // parse the report file name
  String reportFileName = configuration.getChild("reportFile").getValue("./jamon.html");
  this.reportFile = this.makeAbsoluteFile( reportFileName );
  // determine when to create the next report
  this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout;
  // do we create a report on disposal
  this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(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.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0);
  // parse the performance monitor class name
  this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName")
      .getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME);
  // parse the report file name
  String reportFileName = configuration.getChild("reportFile").getValue("./jamon.html");
  this.reportFile = this.makeAbsoluteFile(reportFileName);
  // determine when to create the next report
  this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout;
  // do we create a report on disposal
  this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false);
}

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

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException
{
  super.configure(configuration);
  this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0);
  // parse the performance monitor class name
  this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName").getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME);
  // parse the report file name
  String reportFileName = configuration.getChild("reportFile").getValue("./javasimon.html");
  this.reportFile = this.makeAbsoluteFile( reportFileName );
  // determine when to create the next report
  this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout;
  // do we create a report on disposal
  this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false);
}

代码示例来源: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

/**
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration configuration) throws ConfigurationException {
  // limit to minimum interval of 1 second
  this.interval = Math.max(configuration.getAttributeAsInteger("interval", 5000), 1000);
  this.getLogger().debug("Monitoring the resources every " + this.interval + " ms");
  if (configuration.getChild("entry", false) != null) {
    Configuration shutdownConfig = configuration.getChild("entry");
    String shutdownEntryLocation = shutdownConfig.getChild("location").getValue();
    this.shutdownEntry = new ShutdownEntry(this.getLogger(), this.applicationDir, shutdownEntryLocation,
        shutdownConfig.getChild("useSystemExit").getValueAsBoolean(false));
    this.getLogger().debug("Using a shutdown entry : " + shutdownEntryLocation);
  } else {
    this.shutdownEntry = null;
    this.getLogger().debug("No shutdown entry defined");
  }
}

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

/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
  super.configure(cfg);
  //Bearer bar width
  Configuration c = cfg.getChild("bearer-bar-width", false);
  if (c != null) {
    Length w = new Length(c.getValue(), "mw");
    if (w.getUnit().equalsIgnoreCase("mw")) {
      getITFBean().setBearerBarWidth(w.getValue() * getBean().getModuleWidth());
    } else {
      getITFBean().setBearerBarWidth(w.getValueAsMillimeter());
    }
  }
  //Bearer ox
  c = cfg.getChild("bearer-box", false);
  if (c != null) {
    getITFBean().setBearerBox(c.getValueAsBoolean());
  }
}

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

public void configure(Configuration config) throws ConfigurationException {
  this.startElement = new ElementData();
  this.startElement.uri = config.getChild("start").getAttribute("uri", "");
  this.startElement.loc = config.getChild("start").getAttribute("local-name", "form-instance");
  this.startElement.raw = config.getChild("start").getAttribute("raw-name", "form-instance");
  this.nameElement = new ElementData();
  this.nameElement.uri = config.getChild("name").getAttribute("uri", "");
  this.nameElement.loc = config.getChild("name").getAttribute("local-name", "form");
  this.nameElement.raw = config.getChild("name").getAttribute("raw-name", "form");
  this.qname = config.getChild("name").getAttribute("name-attribute", "name");
  this.nameAsRoot = config.getChild("name-as-root").getValueAsBoolean(this.nameAsRoot);
  this.outputConf = config.getChild("output");
  this.outputModuleName = this.outputConf.getAttribute("name",this.outputModuleName);
}

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

/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
  Interleaved2Of5Bean bean = getInterleaved2Of5Bean();
  //Module width (MUST ALWAYS BE FIRST BECAUSE QUIET ZONE MAY DEPEND ON IT)
  Length mw = new Length(cfg.getChild("module-width")
          .getValue(bean.getModuleWidth() + "mm"), "mm");
  bean.setModuleWidth(mw.getValueAsMillimeter());
  super.configure(cfg);
  //Checksum mode
  bean.setChecksumMode(ChecksumMode.byName(
    cfg.getChild("checksum").getValue(ChecksumMode.CP_AUTO.getName())));
  //Wide factor
  bean.setWideFactor(
    cfg.getChild("wide-factor").getValueAsFloat((float)bean.getWideFactor()));
  Configuration hr = cfg.getChild("human-readable", false);
  if (hr != null) {
    //Display checksum in hr-message or not
    bean.setDisplayChecksum(
        hr.getChild("display-checksum").getValueAsBoolean(false));
  }
}

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

/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
  //Module width (MUST ALWAYS BE FIRST BECAUSE QUIET ZONE MAY DEPEND ON IT)
  Length mw = new Length(cfg.getChild("module-width").getValue("0.21mm"), "mm");
  getBean().setModuleWidth(mw.getValueAsMillimeter());
  super.configure(cfg);
  //Checksum mode
  getCodabarBean().setChecksumMode(ChecksumMode.byName(
    cfg.getChild("checksum").getValue(ChecksumMode.CP_AUTO.getName())));
  //Wide factor
  getCodabarBean().setWideFactor(
    cfg.getChild("wide-factor").getValueAsFloat((float)CodabarBean.DEFAULT_WIDE_FACTOR));
  Configuration hr = cfg.getChild("human-readable", false);
  if (hr != null) {
    //Display start/stop character and checksum in hr-message or not
    getCodabarBean().setDisplayStartStop(
        hr.getChild("display-start-stop").getValueAsBoolean(
            CodabarBean.DEFAULT_DISPLAY_START_STOP));
  }
}

相关文章