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(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(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(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; }
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(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; } }
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 <T> T evaluateAsObject(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { Node node = evaluateAsNode(expression, context); if (node != null) { try { return nodeMapper.mapNode(node, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
@Override public <T> T evaluateAsObject(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { Node node = evaluateAsNode(expression, context); if (node != null) { try { return nodeMapper.mapNode(node, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
@Override public <T> T evaluateAsObject(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { Node node = evaluateAsNode(expression, context); if (node != null) { try { return nodeMapper.mapNode(node, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } }
@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 <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 <T> List<T> evaluate(Node context, NodeMapper<T> nodeMapper) throws XPathException { try { List<?> nodes = xpath.selectNodes(context); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } } }
public <T> List<T> evaluate(Node context, NodeMapper<T> nodeMapper) throws XPathException { try { List<?> nodes = xpath.selectNodes(context); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } } }
@Override public <T> List<T> evaluate(Node context, NodeMapper<T> nodeMapper) throws XPathException { try { List<?> nodes = xpath.selectNodes(context); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } } }
public <T> List<T> evaluate(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); List<?> nodes = xpath.selectNodes(element); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
@Override public <T> List<T> evaluate(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); List<?> nodes = xpath.selectNodes(element); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
@Override public <T> List<T> evaluate(String expression, Source context, NodeMapper<T> nodeMapper) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); List<?> nodes = xpath.selectNodes(element); List<T> results = new ArrayList<T>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node node = (Node) nodes.get(i); try { results.add(nodeMapper.mapNode(node, i)); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } return results; } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
public <T> T evaluateAsObject(Node context, NodeMapper<T> nodeMapper) throws XPathException { try { Node result = (Node) xpath.selectSingleNode(context); if (result != null) { try { return nodeMapper.mapNode(result, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public <T> T evaluateAsObject(Node context, NodeMapper<T> nodeMapper) throws XPathException { try { Node result = (Node) xpath.selectSingleNode(context); if (result != null) { try { return nodeMapper.mapNode(result, 0); } catch (DOMException ex) { throw new XPathException("Mapping resulted in DOMException", ex); } } else { return null; } } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }