@Override public double evaluateAsDouble(String expression, Source context) throws XPathException { Double result = (Double) evaluate(expression, context, XPathConstants.NUMBER); return result != null ? result : Double.NaN; }
@Override public double evaluateAsDouble(String expression, Source context) throws XPathException { Double result = (Double) evaluate(expression, context, XPathConstants.NUMBER); return result != null ? result : Double.NaN; }
@Override public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { Boolean result = (Boolean) evaluate(expression, context, XPathConstants.BOOLEAN); return result != null && result; }
public double evaluateAsDouble(String expression, Source context) throws XPathException { Double result = (Double) evaluate(expression, context, XPathConstants.NUMBER); return result != null ? result : Double.NaN; }
public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { Boolean result = (Boolean) evaluate(expression, context, XPathConstants.BOOLEAN); return result != null && result; }
@Override public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { Boolean result = (Boolean) evaluate(expression, context, XPathConstants.BOOLEAN); return result != null && result; }
@Override public Node evaluateAsNode(String expression, Source context) throws XPathException { return (Node) evaluate(expression, context, XPathConstants.NODE); }
public Node evaluateAsNode(String expression, Source context) throws XPathException { return (Node) evaluate(expression, context, XPathConstants.NODE); }
@Override public Node evaluateAsNode(String expression, Source context) throws XPathException { return (Node) evaluate(expression, context, XPathConstants.NODE); }
@Override public String evaluateAsString(String expression, Source context) throws XPathException { return (String) evaluate(expression, context, XPathConstants.STRING); }
public String evaluateAsString(String expression, Source context) throws XPathException { return (String) evaluate(expression, context, XPathConstants.STRING); }
@Override public String evaluateAsString(String expression, Source context) throws XPathException { return (String) evaluate(expression, context, XPathConstants.STRING); }
public List<Node> evaluateAsNodeList(String expression, Source context) throws XPathException { NodeList result = (NodeList) evaluate(expression, context, XPathConstants.NODESET); List<Node> nodes = new ArrayList<Node>(result.getLength()); for (int i = 0; i < result.getLength(); i++) { nodes.add(result.item(i)); } return nodes; }
@Override public List<Node> evaluateAsNodeList(String expression, Source context) throws XPathException { NodeList result = (NodeList) evaluate(expression, context, XPathConstants.NODESET); List<Node> nodes = new ArrayList<Node>(result.getLength()); for (int i = 0; i < result.getLength(); i++) { nodes.add(result.item(i)); } return nodes; }
@Override public List<Node> evaluateAsNodeList(String expression, Source context) throws XPathException { NodeList result = (NodeList) evaluate(expression, context, XPathConstants.NODESET); List<Node> nodes = new ArrayList<Node>(result.getLength()); for (int i = 0; i < result.getLength(); i++) { nodes.add(result.item(i)); } return nodes; }
public <T> List<T> evaluate(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(expression, context, 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(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(expression, context, 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(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(expression, context, 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; }