org.jvnet.hk2.config.Dom.nodeElements()方法的使用及代码示例

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

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

Dom.nodeElements介绍

[英]Picks up all node-elements that have the given element name.
[中]拾取具有给定元素名称的所有节点元素。

代码示例

代码示例来源:origin: javaee/glassfish

public void element_setIndexItems(Dom dom, Index target) {
  List<Dom> v1 = dom.nodeElements("indexitem");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.IndexItem>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.IndexItem) v3 .get()));
  }
  target.setIndexItems(v2);
}

代码示例来源:origin: javaee/glassfish

public void element_setIndexItems(Dom dom, org.glassfish.admingui.connector.IndexItem target) {
  List<Dom> v1 = dom.nodeElements("indexitem");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.IndexItem>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.IndexItem) v3 .get()));
  }
  target.setIndexItems(v2);
}

代码示例来源:origin: javaee/glassfish

public void element_setTOCItems(Dom dom, org.glassfish.admingui.connector.TOCItem target) {
  List<Dom> v1 = dom.nodeElements("tocitem");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.TOCItem>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.TOCItem) v3 .get()));
  }
  target.setTOCItems(v2);
}

代码示例来源:origin: javaee/glassfish

public void element_setTOCItems(Dom dom, TOC target) {
  List<Dom> v1 = dom.nodeElements("tocitem");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.TOCItem>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.TOCItem) v3 .get()));
  }
  target.setTOCItems(v2);
}

代码示例来源:origin: javaee/glassfish

public void element_setIntegrationPoints(Dom dom, ConsoleConfig target) {
  List<Dom> v1 = dom.nodeElements("integration-point");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.IntegrationPoint>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.IntegrationPoint) v3 .get()));
  }
  target.setIntegrationPoints(v2);
}

代码示例来源:origin: javaee/glassfish

public void element_setGadgetUserPref(Dom dom, GadgetModule target) {
  List<Dom> v1 = dom.nodeElements("UserPref");
  if (v1 == null) {
    return ;
  }
  List v2 = new ArrayList<org.glassfish.admingui.connector.GadgetUserPref>(v1 .size());
  for (Dom v3 : v1) {
    v2 .add(((org.glassfish.admingui.connector.GadgetUserPref) v3 .get()));
  }
  target.setGadgetUserPref(v2);
}

代码示例来源:origin: javaee/glassfish

final Class itemType = Types.erasure(Types.getTypeArgument(returnType,0));
final List<Dom> v = ("*".equals(xmlName)?dom.domNodeByTypeElements(itemType):dom.nodeElements(xmlName));

代码示例来源:origin: org.glassfish.main.admin/server-mgmt

private void checkUnique(Dom d) {
  try {
    Set<String> eltnames = d.getElementNames();
    Set<String> leafeltnames = d.model.getLeafElementNames();
    for (String elt : eltnames) {
      if (leafeltnames.contains(elt)) continue;
      List<Dom> eltlist = d.nodeElements(elt);
      checkDuplicate(eltlist);
      for (Dom subelt : eltlist) {
        checkUnique(subelt);
      }
    }
   } catch(Exception e) {
    error = true;
    e.printStackTrace();
  }
}

代码示例来源:origin: org.glassfish.hk2/config

final Class itemType = Types.erasure(Types.getTypeArgument(returnType,0));
final List<Dom> v = ("*".equals(xmlName)?dom.domNodeByTypeElements(itemType):dom.nodeElements(xmlName));

代码示例来源:origin: eclipse-ee4j/glassfish

final Class itemType = Types.erasure(Types.getTypeArgument(returnType,0));
final List<Dom> v = ("*".equals(xmlName)?dom.domNodeByTypeElements(itemType):dom.nodeElements(xmlName));

代码示例来源:origin: com.sun.enterprise/config

final Class itemType = Types.erasure(Types.getTypeArgument(returnType,0));
final List<Dom> v = ("*".equals(xmlName)?dom.domNodeByTypeElements(itemType):dom.nodeElements(xmlName));

代码示例来源:origin: org.glassfish.hk2/hk2-config

final Class itemType = Types.erasure(Types.getTypeArgument(returnType,0));
final List<Dom> v = ("*".equals(xmlName)?dom.domNodeByTypeElements(itemType):dom.nodeElements(xmlName));

代码示例来源:origin: com.sun.grizzly/grizzly-config

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

代码示例来源:origin: org.glassfish.main.core/kernel

for (Dom child : parent.nodeElements(childName)) {

代码示例来源:origin: org.glassfish.main.core/kernel

private static void listRefs(Dom dom, String value, List<String> refs) {
    //this method is rather ugly, but it works. See 9340 which presents a compatibility issue
    //frankly, it makes no sense to do an extensive search of all references of <system-property> being deleted,
    //but that's what resolution of this issue demands. --- Kedar 10/5/2009
    for (String aname : dom.getAttributeNames()) {
      String raw = dom.rawAttribute(aname);
      if (raw != null && raw.equals(value)) {
        refs.add(dom.model.getTagName() + ":" + aname);
      }
    }
    for (String ename : dom.getElementNames()) {
      List<Dom> nodes = null;
      try {
        nodes = dom.nodeElements(ename);
      } catch(Exception e) {
        //ignore, in some situations, HK2 might throw ClassCastException here
      }
      if (nodes != null) {
        for (Dom node : nodes)
          listRefs(node, value, refs);  //beware: recursive call ...
      }
    }
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-config

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

代码示例来源:origin: eclipse-ee4j/glassfish

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

代码示例来源:origin: org.glassfish.main.admin/config-api

Collection<Dom> collection = parentDom.nodeElements(elementName);
if (collection==null) {
  return null;

代码示例来源:origin: org.glassfish.admin/config-api

Collection<Dom> collection = parentDom.nodeElements(elementName);
if (collection==null) {
  return null;

相关文章