src/main/java/org/jsoup/helper/W3CDom.java
/**
     Retrieves the original jsoup DOM nodes from a nodelist created by this convertor.
     @param nodeList the W3C nodes to get the original jsoup nodes from
     @param nodeType the jsoup node type to retrieve (e.g. Element, DataNode, etc)
     @param <T> node type
     @return a list of the original nodes
     */
Retrieves the original jsoup DOM nodes from a nodelist created by this convertor.
Retrieves the original jsoup DOM nodes from a nodelist created by this convertor .
public <T extends org.jsoup.nodes.Node> List<T> sourceNodes(NodeList nodeList, Class<T> nodeType) {
        Validate.notNull(nodeList);
        Validate.notNull(nodeType);
        List<T> nodes = new ArrayList<>(nodeList.getLength());
        for (int i = 0; i < nodeList.getLength(); i++) {
            org.w3c.dom.Node node = nodeList.item(i);
            Object source = node.getUserData(W3CDom.SourceProperty);
            if (nodeType.isInstance(source))
                nodes.add(nodeType.cast(source));
        }
        return nodes;
    }
public < T extends org . jsoup . nodes . Node > List < T > sourceNodes ( NodeList nodeList , Class < T > nodeType ) { Validate . notNull ( nodeList ) ; Validate . notNull ( nodeType ) ; List < T > nodes = new ArrayList < > ( nodeList . getLength ( ) ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { org . w3c . dom . Node node = nodeList . item ( i ) ; Object source = node . getUserData ( W3CDom . SourceProperty ) ; if ( nodeType . isInstance ( source ) ) nodes . add ( nodeType . cast ( source ) ) ; } return nodes ; }
Retrieves the original jsoup DOM nodes from a nodelist created by this convertor.
Retrieves the original jsoup DOM nodes from a nodelist created by this convertor .