public <T> List<T> evaluate(Node node, NodeMapper<T> nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(node, XPathConstants.NODESET); List<T> results = new ArrayList<T>(nodes.getLength()); for (int i = 0; i < nodes.getLength(); i++) { try { results.add(nodeMapper.mapNode(nodes.item(i), i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } }
@Override public <T> List<T> evaluate(Node node, NodeMapper<T> nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(node, XPathConstants.NODESET); List<T> results = new ArrayList<T>(nodes.getLength()); for (int i = 0; i < nodes.getLength(); i++) { try { results.add(nodeMapper.mapNode(nodes.item(i), i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } }
@Override public <T> T evaluateAsObject(Node node, NodeMapper<T> nodeMapper) throws XPathException { Node result = (Node) evaluate(node, XPathConstants.NODE); if (result != null) { try { return nodeMapper.mapNode(result, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
public Node evaluateAsNode(Node node) { return (Node) evaluate(node, XPathConstants.NODE); }
public boolean evaluateAsBoolean(Node node) { return (Boolean) evaluate(node, XPathConstants.BOOLEAN); }
public String evaluateAsString(Node node) { return (String) evaluate(node, XPathConstants.STRING); }
public <T> T evaluateAsObject(Node node, NodeMapper<T> nodeMapper) throws XPathException { Node result = (Node) evaluate(node, XPathConstants.NODE); if (result != null) { try { return nodeMapper.mapNode(result, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
@Override public Node evaluateAsNode(Node node) { return (Node) evaluate(node, XPathConstants.NODE); }
@Override public boolean evaluateAsBoolean(Node node) { return (Boolean) evaluate(node, XPathConstants.BOOLEAN); }
@Override public <T> T evaluateAsObject(Node node, NodeMapper<T> nodeMapper) throws XPathException { Node result = (Node) evaluate(node, XPathConstants.NODE); if (result != null) { try { return nodeMapper.mapNode(result, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
@Override public String evaluateAsString(Node node) { return (String) evaluate(node, XPathConstants.STRING); }
@Override public boolean evaluateAsBoolean(Node node) { return (Boolean) evaluate(node, XPathConstants.BOOLEAN); }
@Override public double evaluateAsNumber(Node node) { return (Double) evaluate(node, XPathConstants.NUMBER); }
public List<Node> evaluateAsNodeList(Node node) { NodeList nodeList = (NodeList) evaluate(node, XPathConstants.NODESET); return toNodeList(nodeList); }
@Override public double evaluateAsNumber(Node node) { return (Double) evaluate(node, XPathConstants.NUMBER); }
@Override public String evaluateAsString(Node node) { return (String) evaluate(node, XPathConstants.STRING); }
@Override public List<Node> evaluateAsNodeList(Node node) { NodeList nodeList = (NodeList) evaluate(node, XPathConstants.NODESET); return toNodeList(nodeList); }
public double evaluateAsNumber(Node node) { return (Double) evaluate(node, XPathConstants.NUMBER); }
@Override public List<Node> evaluateAsNodeList(Node node) { NodeList nodeList = (NodeList) evaluate(node, XPathConstants.NODESET); return toNodeList(nodeList); }
@Override public Node evaluateAsNode(Node node) { return (Node) evaluate(node, XPathConstants.NODE); }