gpt4 book ai didi

com.cloud.utils.xmlobject.XmlObject.getAsList()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 09:49:05 25 4
gpt4 key购买 nike

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

XmlObject.getAsList介绍

暂无

代码示例

代码示例来源:origin: apache/cloudstack

public static List<ComputeBlade> fromXmString(String xmlstr) {
  XmlObject root = XmlObjectParser.parseFromString(xmlstr);
  List<XmlObject> lst = root.getAsList("outConfigs.computeBlade");
  List<ComputeBlade> blades = new ArrayList<ComputeBlade>();
  if (lst == null) {
    return blades;
  }
  for (XmlObject xo : lst) {
    blades.add(fromXmlObject(xo));
  }
  return blades;
}

代码示例来源:origin: apache/cloudstack

public static List<UcsProfile> fromXmlString(String xmlstr) {
  List<UcsProfile> ps = new ArrayList<UcsProfile>();
  XmlObject xo = XmlObjectParser.parseFromString(xmlstr);
  List<XmlObject> xos = xo.getAsList("outDns.dn");
  if (xos != null) {
    for (XmlObject x : xos) {
      //UcsProfile p = UcsProfile.fromXmlObject(x);
      UcsProfile p = new UcsProfile();
      p.setDn(x.get("value").toString());
      ps.add(p);
    }
  }
  return ps;
}

代码示例来源:origin: apache/cloudstack

PortInfo port = new PortInfo(struct);
XmlObject xml = XmlObjectParser.parseFromString((String)rsp.getBody());
List<XmlObject> ports = xml.getAsList("untagged.tengigabitethernet");
ports.addAll(xml.<XmlObject>getAsList("untagged.gigabitethernet"));
ports.addAll(xml.<XmlObject>getAsList("untagged.fortyGigE"));
List<XmlObject> newPorts = new ArrayList<>();
boolean needRemove = false;

代码示例来源:origin: apache/cloudstack

PortInfo port = new PortInfo(struct);
XmlObject xml = XmlObjectParser.parseFromString((String)rsp.getBody());
List<XmlObject> ports = xml.getAsList("untagged.tengigabitethernet");
ports.addAll(xml.<XmlObject>getAsList("untagged.gigabitethernet"));
ports.addAll(xml.<XmlObject>getAsList("untagged.fortyGigE"));
for (XmlObject pxml : ports) {
  XmlObject name = pxml.get("name");

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