org.jdom.Attribute.getBooleanValue()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(136)

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

Attribute.getBooleanValue介绍

[英]This gets the effective boolean value of the attribute, or throws a DataConversionException if a conversion can't be performed. True values are: "true", "on", "1", and "yes". False values are: "false", "off", "0", and "no". Values are trimmed before comparison. Values other than those listed here throw the exception.
[中]这将获取属性的有效布尔值,如果无法执行转换,则抛出DataConversionException。真实值为:“真”、“开”、“1”和“是”。错误值为:“错误”、“关闭”、“0”和“否”。值在比较之前被修剪。此处列出的值以外的值引发异常。

代码示例

代码示例来源:origin: kiegroup/optaplanner

Element minElement, Element maxElement,
  ContractLineType contractLineType) throws DataConversionException {
boolean minimumEnabled = minElement == null ? false : minElement.getAttribute("on").getBooleanValue();
int minimumWeight;
if (minimumEnabled) {
  minimumWeight = 0;
boolean maximumEnabled = maxElement == null ? false : maxElement.getAttribute("on").getBooleanValue();
int maximumWeight;
if (maximumEnabled) {

代码示例来源:origin: rome/modules

private Boolean parseBooleanAttr(Element sharingChild, String attrName) {
  Attribute attribute = sharingChild.getAttribute(attrName);
  Boolean attrValue = null;
  if (attribute != null) {
    try {
      attrValue = Boolean.valueOf(attribute.getBooleanValue());
    } catch (DataConversionException e) {
      // dont use the data
    }
  }
  return attrValue;
}

代码示例来源:origin: org.rometools/rome-modules

private Boolean parseBooleanAttr(Element sharingChild, String attrName) {
  Attribute attribute = sharingChild.getAttribute(attrName);
  Boolean attrValue = null;
  if (attribute != null) {
    try {
      attrValue = Boolean.valueOf(attribute.getBooleanValue());
    } catch (DataConversionException e) {
      // dont use the data
    }
  }
  return attrValue;
}

代码示例来源:origin: Tapadoo/TCSlackNotifierPlugin

public void readFrom(Element element) {
  Element channelElement = element.getChild(ELEMENT_CHANNEL);
  Element logoElement = element.getChild(ELEMENT_LOGO_URL);
  Attribute enabledAttr = element.getAttribute(ATTR_ENABLED);
  if( enabledAttr != null )
  {
    try {
      enabled = enabledAttr.getBooleanValue() ;
    } catch (DataConversionException e) {
      enabled = true ;
    }
  }
  else
  {
    enabled = true ;
  }
  if( channelElement != null ) {
    this.channel = channelElement.getText();
  }
  if( logoElement != null )
  {
    this.logoUrl = logoElement.getText();
  }
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * The entry point to this class. This function takes a method element and
 * processes it, adding instructions to release and retain objects as
 * needed. For the command set that it adds, see the InstructionProcessor
 * class.
 */
@SuppressWarnings("unchecked")
public void process(Element method) throws DataConversionException, ReferenceCountingException
{
  Attribute isAbstract= method.getAttribute("isAbstract");
  Attribute isNative= method.getAttribute("isNative");
  // abstract and native methods do not require processing
  if (isAbstract != null && isAbstract.getBooleanValue())
  {
    return;
  }
  if (isNative != null && isNative.getBooleanValue())
  {
    return;
  }
  Element codeElement= method.getChild("code", dex);
  int numReg= codeElement.getAttribute("register-size").getIntValue();
  processRecStart(numReg, (List<Element>) codeElement.getChildren(), codeElement);
}

代码示例来源:origin: Tapadoo/TCSlackNotifierPlugin

postSuccessful = postSuccessfulAttr.getBooleanValue();
postStarted = postStartedAttr.getBooleanValue();
postFailed = postFailedAttr.getBooleanValue();

代码示例来源:origin: info.magnolia/magnolia-module-forum

if ("MetaData".equals(childDef.getAttribute("name").getValue())
    && "mgnl:metaData".equals(childDef.getAttribute("defaultPrimaryType").getValue())
    && childDef.getAttribute("autoCreated").getBooleanValue()
    && childDef.getAttribute("mandatory").getBooleanValue()) {
  foundChildDef = true;
  break;

代码示例来源:origin: tcplugins/tcWebHooks

eState.getAttribute(ATTR_ENABLED).getBooleanValue());
    } catch (DataConversionException e1) {
      Loggers.SERVER.warn(LOG_PREFIX_WEB_HOOK_CONFIG + e1.getMessage());
if (eTypes.getAttribute(ATTR_ENABLED_FOR_ALL) != null){
  try {
    this.enableForAllBuildsInProject(eTypes.getAttribute(ATTR_ENABLED_FOR_ALL).getBooleanValue());
  } catch (DataConversionException e1) {
    Loggers.SERVER.warn(LOG_PREFIX_WEB_HOOK_CONFIG + e1.getMessage());
    this.enableForSubProjects(eTypes.getAttribute(ATTR_ENABLED_FOR_SUBPROJECTS).getBooleanValue());
  } catch (DataConversionException e1) {
    Loggers.SERVER.warn(LOG_PREFIX_WEB_HOOK_CONFIG + e1.getMessage());
    authEnabled = eAuth.getAttribute(ATTR_ENABLED).getBooleanValue();
  } catch (DataConversionException e1){
      authPreemptive = eAuth.getAttribute(ATTR_PREEMPTIVE).getBooleanValue();

代码示例来源:origin: PeteGoo/tcSlackBuildNotifier

eState.getAttribute(ENABLED).getBooleanValue());
    } catch (DataConversionException e1) {e1.printStackTrace();}
if (eTypes.getAttribute(ENABLED_FOR_ALL) != null){
  try {
    this.enableForAllBuildsInProject(eTypes.getAttribute(ENABLED_FOR_ALL).getBooleanValue());
  } catch (DataConversionException e1) {e1.printStackTrace();}
    this.enableForSubProjects(eTypes.getAttribute(ENABLED_FOR_SUBPROJECTS).getBooleanValue());
  } catch (DataConversionException e1) {e1.printStackTrace();}

代码示例来源:origin: org.optaplanner/optaplanner-examples

Element minElement, Element maxElement,
  ContractLineType contractLineType) throws DataConversionException {
boolean minimumEnabled = minElement == null ? false : minElement.getAttribute("on").getBooleanValue();
int minimumWeight;
if (minimumEnabled) {
  minimumWeight = 0;
boolean maximumEnabled = maxElement == null ? false : maxElement.getAttribute("on").getBooleanValue();
int maximumWeight;
if (maximumEnabled) {

代码示例来源:origin: jwpttcg66/redis-game-transaction

public JedisPoolConfig initRediPoolConfig() throws DataConversionException {
  Element element = JdomUtils.getRootElemet(FileUtil.getConfigURL(GlobalConstants.RedisConfigFile.REDIS_POOL_CONIFG).getFile());
  JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
  int maxIdle = element.getAttribute("maxIdle").getIntValue();
  boolean testWhileIdle = element.getAttribute("testWhileIdle").getBooleanValue();
  int timeBetweenEvictionRunsMillis = element.getAttribute("timeBetweenEvictionRunsMillis").getIntValue();
  int numTestsPerEvictionRun = element.getAttribute("numTestsPerEvictionRun").getIntValue();
  int minEvictableIdleTimeMillis = element.getAttribute("minEvictableIdleTimeMillis").getIntValue();
  jedisPoolConfig.setTestWhileIdle(testWhileIdle);
  jedisPoolConfig.setMaxIdle(maxIdle);
  jedisPoolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
  jedisPoolConfig.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
  jedisPoolConfig.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  return jedisPoolConfig;
}

相关文章