dss/src/main/java/gov/samhsa/c2s/dss/service/document/redact/base/AbstractRedactionHandler.java
protected final RedactionHandlerResult addNodesToList(Document xmlDocument, String xPathExpr, String... values) {
        try {
            Stream<Node> nodeStream = documentAccessor
                    .getNodeListAsStream(xmlDocument, xPathExpr, values);
            final List<Node> listOfNodes = nodeStream
                    .map(this::markRedactForTryPolicyIfElement)
                    .collect(toList());
            RedactionHandlerResult redactionHandlerResult = new RedactionHandlerResult();
            redactionHandlerResult.setRedactNodeList(listOfNodes);
            if (!listOfNodes.isEmpty() && values != null && values.length > 0) {
                redactionHandlerResult.getRedactSectionCodesAndGeneratedEntryIds().add(values[0]);
            }
            return redactionHandlerResult;
        } catch (XPathExpressionException e) {
            throw new RedactionHandlerException(e);
        }
    }
/**
     * Adds the nodes to list.
     *
     * @param xmlDocument the xml document
     * @param xPathExpr   the x path expr
     * @param values      the values
     * @return the RedactionHandlerResult
     */
Adds the nodes to list.
@param xmlDocument the xml document
@param xPathExpr   the x path expr
@param values      the values
@return the RedactionHandlerResult
Adds the nodes to list . @param xmlDocument the xml document @param xPathExpr the x path expr @param values the values @return the RedactionHandlerResult
protected final RedactionHandlerResult addNodesToList(Document xmlDocument, String xPathExpr, String... values) {
        try {
            Stream<Node> nodeStream = documentAccessor
                    .getNodeListAsStream(xmlDocument, xPathExpr, values);
            final List<Node> listOfNodes = nodeStream
                    .map(this::markRedactForTryPolicyIfElement)
                    .collect(toList());
            RedactionHandlerResult redactionHandlerResult = new RedactionHandlerResult();
            redactionHandlerResult.setRedactNodeList(listOfNodes);
            if (!listOfNodes.isEmpty() && values != null && values.length > 0) {
                redactionHandlerResult.getRedactSectionCodesAndGeneratedEntryIds().add(values[0]);
            }
            return redactionHandlerResult;
        } catch (XPathExpressionException e) {
            throw new RedactionHandlerException(e);
        }
    }
protected final RedactionHandlerResult addNodesToList ( Document xmlDocument , String xPathExpr , String ... values ) { try { Stream < Node > nodeStream = documentAccessor . getNodeListAsStream ( xmlDocument , xPathExpr , values ) ; final List < Node > listOfNodes = nodeStream . map ( this :: markRedactForTryPolicyIfElement ) . collect ( toList ( ) ) ; RedactionHandlerResult redactionHandlerResult = new RedactionHandlerResult ( ) ; redactionHandlerResult . setRedactNodeList ( listOfNodes ) ; if ( ! listOfNodes . isEmpty ( ) && values != null && values . length > 0 ) { redactionHandlerResult . getRedactSectionCodesAndGeneratedEntryIds ( ) . add ( values [ 0 ] ) ; } return redactionHandlerResult ; } catch ( XPathExpressionException e ) { throw new RedactionHandlerException ( e ) ; } }
Adds the nodes to list.
Adds the nodes to list .