org.apache.xml.security.signature.XMLSignatureInput.isNeedsToBeExpanded()方法的使用及代码示例

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

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

XMLSignatureInput.isNeedsToBeExpanded介绍

[英]Check if the structure needs to be expanded.
[中]检查结构是否需要扩展。

代码示例

代码示例来源:origin: be.fedict.eid-applet/eid-applet-service-signer

private Set getNodeSet(List nodeFilters) {
    if (xi.isNeedsToBeExpanded()) {
      XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(xi.getSubNode()));
    }

    Set inputSet = new LinkedHashSet();
    XMLUtils.getSet(xi.getSubNode(), inputSet, null, !xi.isExcludeComments());
    Set nodeSet = new LinkedHashSet();
    Iterator i = inputSet.iterator();
    while (i.hasNext()) {
      Node currentNode = (Node) i.next();
      Iterator it = nodeFilters.iterator();
      boolean skipNode = false;
      while (it.hasNext() && !skipNode) {
        NodeFilter nf = (NodeFilter) it.next();
        if (nf.isNodeInclude(currentNode) != 1) {
          skipNode = true;
        }
      }
      if (!skipNode) {
        nodeSet.add(currentNode);
      }
    }
    return nodeSet;
  }
}

代码示例来源:origin: org.apache.santuario/xmlsec

protected void circumventBugIfNeeded(XMLSignatureInput input)
    throws CanonicalizationException, ParserConfigurationException,
        IOException, SAXException {
    if (!input.isNeedsToBeExpanded() || inclusiveNSSet.isEmpty() || inclusiveNSSet.isEmpty()) {
      return;
    }
    Document doc = null;
    if (input.getSubNode() != null) {
      doc = XMLUtils.getOwnerDocument(input.getSubNode());
    } else {
      doc = XMLUtils.getOwnerDocument(input.getNodeSet());
    }
    XMLUtils.circumventBug2650(doc);
  }
}

代码示例来源:origin: org.apache.santuario/xmlsec

private Set<Node> getNodeSet(List<NodeFilter> nodeFilters) {
    if (xi.isNeedsToBeExpanded()) {
      XMLUtils.circumventBug2650
        (XMLUtils.getOwnerDocument(xi.getSubNode()));
    }

    Set<Node> inputSet = new LinkedHashSet<Node>();
    XMLUtils.getSet(xi.getSubNode(), inputSet,
            null, !xi.isExcludeComments());
    Set<Node> nodeSet = new LinkedHashSet<Node>();
    for (Node currentNode : inputSet) {
      Iterator<NodeFilter> it = nodeFilters.iterator();
      boolean skipNode = false;
      while (it.hasNext() && !skipNode) {
        NodeFilter nf = it.next();
        if (nf.isNodeInclude(currentNode) != 1) {
          skipNode = true;
        }
      }
      if (!skipNode) {
        nodeSet.add(currentNode);
      }
    }
    return nodeSet;
  }
}

代码示例来源:origin: org.apache.santuario/xmlsec

protected void circumventBugIfNeeded(XMLSignatureInput input)
  throws CanonicalizationException, ParserConfigurationException, IOException, SAXException {
  if (!input.isNeedsToBeExpanded()) {
    return;
  }
  Document doc = null;
  if (input.getSubNode() != null) {
    doc = XMLUtils.getOwnerDocument(input.getSubNode());
  } else {
    doc = XMLUtils.getOwnerDocument(input.getNodeSet());
  }
  XMLUtils.circumventBug2650(doc);
}

相关文章