com.thoughtworks.xstream.io.xml.xppdom.XppDom.getChildren()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(166)

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

XppDom.getChildren介绍

暂无

代码示例

代码示例来源:origin: senbox-org/snap-desktop

void setDisplayParameters(final XppDom presentationXML) {
  for (XppDom params : presentationXML.getChildren()) {
    final String id = params.getAttribute("id");
    if (id != null && id.equals(node.getId())) {
      displayParameters = params;
      final XppDom dpElem = displayParameters.getChild("displayPosition");
      if (dpElem != null) {
        displayPosition.x = (int) Float.parseFloat(dpElem.getAttribute("x"));
        displayPosition.y = (int) Float.parseFloat(dpElem.getAttribute("y"));
      }
      return;
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

void AssignDisplayParameters(final XppDom presentationXML) {
  XppDom nodeElem = null;
  for (XppDom elem : presentationXML.getChildren()) {
    final String id = elem.getAttribute("id");
    if (id != null && id.equals(node.getId())) {
      nodeElem = elem;
      break;
    }
  }
  if (nodeElem == null) {
    presentationXML.addChild(displayParameters);
  }
  XppDom dpElem = displayParameters.getChild("displayPosition");
  if (dpElem == null) {
    dpElem = new XppDom("displayPosition");
    displayParameters.addChild(dpElem);
  }
  dpElem.setAttribute("y", String.valueOf(displayPosition.getY()));
  dpElem.setAttribute("x", String.valueOf(displayPosition.getX()));
}

代码示例来源:origin: bcdev/beam

@Override
public void marshal(Object source, HierarchicalStreamWriter writer,
          MarshallingContext context) {
  ApplicationData applicationData = (ApplicationData) source;
  writer.addAttribute(ID_ATTRIBUTE_NAME, applicationData.appId);
  XppDom[] children = applicationData.data.getChildren();
  for (XppDom child : children) {
    HierarchicalStreamCopier copier = new HierarchicalStreamCopier();
    XppDomReader reader = new XppDomReader(child);
    copier.copy(reader, writer);
  }
}

相关文章