javax.xml.crypto.dsig.spec.XPathFilterParameterSpec Java Examples

The following examples show how to use javax.xml.crypto.dsig.spec.XPathFilterParameterSpec. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DOMXPathTransform.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #2
Source File: DOMXPathTransform.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #3
Source File: DOMXPathTransform.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #4
Source File: DOMXPathTransform.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #5
Source File: DOMXPathTransform.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #6
Source File: DOMXPathTransform.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #7
Source File: DOMXPathTransform.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #8
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #9
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #10
Source File: DOMXPathTransform.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #11
Source File: DOMXPathTransform.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #12
Source File: DOMXPathTransform.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #13
Source File: DOMXPathTransform.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #14
Source File: DOMXPathTransform.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #15
Source File: DOMXPathTransform.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #16
Source File: DOMXPathTransform.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #17
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #18
Source File: DOMXPathTransform.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #19
Source File: DOMXPathTransform.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #20
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #21
Source File: DOMXPathTransform.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #22
Source File: DOMXPathTransform.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #23
Source File: DOMXPathTransform.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #24
Source File: DOMXPathTransform.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #25
Source File: DOMXPathTransform.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void unmarshalParams(Element paramsElem) {
    String xPath = paramsElem.getFirstChild().getNodeValue();
    // create a Map of namespace prefixes
    NamedNodeMap attributes = paramsElem.getAttributes();
    if (attributes != null) {
        int length = attributes.getLength();
        Map<String, String> namespaceMap =
            new HashMap<String, String>(length);
        for (int i = 0; i < length; i++) {
            Attr attr = (Attr)attributes.item(i);
            String prefix = attr.getPrefix();
            if (prefix != null && prefix.equals("xmlns")) {
                namespaceMap.put(attr.getLocalName(), attr.getValue());
            }
        }
        this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
    } else {
        this.params = new XPathFilterParameterSpec(xPath);
    }
}
 
Example #26
Source File: DOMXPathTransform.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    XPathFilterParameterSpec xp =
        (XPathFilterParameterSpec)getParameterSpec();
    Element xpathElem = DOMUtils.createElement(ownerDoc, "XPath",
         XMLSignature.XMLNS, DOMUtils.getSignaturePrefix(context));
    xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

    // add namespace attributes, if necessary
    @SuppressWarnings("unchecked")
    Set<Map.Entry<String, String>> entries =
        xp.getNamespaceMap().entrySet();
    for (Map.Entry<String, String> entry : entries) {
        xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                 entry.getKey(),
                                 entry.getValue());
    }

    transformElem.appendChild(xpathElem);
}
 
Example #27
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params == null) {
        throw new InvalidAlgorithmParameterException("params are required");
    } else if (!(params instanceof XPathFilterParameterSpec)) {
        throw new InvalidAlgorithmParameterException
            ("params must be of type XPathFilterParameterSpec");
    }
    this.params = params;
}
 
Example #28
Source File: DOMXPathTransform.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params == null) {
        throw new InvalidAlgorithmParameterException("params are required");
    } else if (!(params instanceof XPathFilterParameterSpec)) {
        throw new InvalidAlgorithmParameterException
            ("params must be of type XPathFilterParameterSpec");
    }
    this.params = params;
}
 
Example #29
Source File: DOMXPathTransform.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params == null) {
        throw new InvalidAlgorithmParameterException("params are required");
    } else if (!(params instanceof XPathFilterParameterSpec)) {
        throw new InvalidAlgorithmParameterException
            ("params must be of type XPathFilterParameterSpec");
    }
    this.params = params;
}
 
Example #30
Source File: DOMXPathTransform.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params == null) {
        throw new InvalidAlgorithmParameterException("params are required");
    } else if (!(params instanceof XPathFilterParameterSpec)) {
        throw new InvalidAlgorithmParameterException
            ("params must be of type XPathFilterParameterSpec");
    }
    this.params = params;
}