gpt4 book ai didi

org.bedework.util.xml.XmlUtil.hasChildren()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 13:07:40 25 4
gpt4 key购买 nike

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

XmlUtil.hasChildren介绍

[英]See if this node has any children
[中]查看此节点是否有子节点

代码示例

代码示例来源:origin: org.bedework/bw-util-xml

/** See if this node is empty
 *
 * @param el
 * @return boolean   true for empty
 * @throws SAXException
 */
public static boolean isEmpty(final Element el) throws SAXException {
 return !hasChildren(el) && !hasContent(el);
}

代码示例来源:origin: org.bedework/bw-util-xml

private Object simpleValue(final Class cl,
              final Element el) throws Throwable {
 if (!XmlUtil.hasChildren(el)) {
  /* A primitive value for which we should have a setter */
  final String ndval = XmlUtil.getElementContent(el);
  if (cl.getName().equals("java.lang.String")) {
   return ndval;
  }
  if (cl.getName().equals("int") ||
    cl.getName().equals("java.lang.Integer")) {
   return Integer.valueOf(ndval);
  }
  if (cl.getName().equals("long") ||
    cl.getName().equals("java.lang.Long")) {
   return Long.valueOf(ndval);
  }
  if (cl.getName().equals("boolean") ||
    cl.getName().equals("java.lang.Boolean")) {
   return Boolean.valueOf(ndval);
  }
  // XXX Should do byte, char, short, float, and double.
  return cb.simpleValue(cl, ndval);
 }
 // Complex value
 return null;
}

代码示例来源:origin: org.bedework/bw-util-config

private Object simpleValue(final Class cl,
              final Element el,
              final String name) throws Throwable {
 if (XmlUtil.hasChildren(el)) {

代码示例来源:origin: org.bedework/bw-util-config

if (!XmlUtil.hasChildren(subroot)) {

代码示例来源:origin: org.bedework/bw-util-xml

if (!XmlUtil.hasChildren(subroot)) {

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com