public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
/** * Returns the number value of the first item selected by applying the * wrapped XPath expression to the given context. * * @param context * the element to use as context for evaluating the XPath expression. * @return the number value of the first item selected by applying the * wrapped XPath expression to the given context, <code>null</code> * if no node was selected or the special value * {@link java.lang.Double#NaN} (Not-a-Number) if the selected value * can not be converted into a number value. * @throws JDOMException * if the XPath expression is invalid or its evaluation on the * specified context failed. */ @Override public Number numberValueOf(Object context) throws JDOMException { try { navigator.setContext(context); return xPath.numberValueOf(context); } catch (JaxenException ex1) { throw new JDOMException( "XPath error while evaluating \"" + xPath.toString() + "\": " + ex1.getMessage(), ex1); } finally { navigator.reset(); } }
@Override public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
@Override public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number numberValueOf(Object context) { try { setNSContext(context); return xpath.numberValueOf(context); } catch (JaxenException e) { handleJaxenException(e); return null; } }
public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException { try { return compile((OXPath10Expression) cexp).numberValueOf(createContext((OXPath10Expression) cexp, ctx)); } catch (JaxenException e) { handleJaxenException(e); } throw new AssertionError("UNREACHABLE"); }
public Number numericValueOf(String path, Base base, Map<String, String> namespaces, Map<QName, Function> functions, Map<QName, Object> variables) throws XPathException { try { base = getElementWrapped(base); XPath xpath = getXPath(path, namespaces, functions, variables); return xpath.numberValueOf(base); } catch (JaxenException e) { throw new XPathException(e); } }
@Override public double evaluateAsDouble(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.numberValueOf(element).doubleValue(); } 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 double evaluateAsDouble(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.numberValueOf(element).doubleValue(); } 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 double evaluateAsDouble(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.numberValueOf(element).doubleValue(); } 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 protected double evaluateToNumber(final String expression, @Nullable final BinderXPathVariableResolver resolver, @Nullable final Node node) throws DomBindingException { nonNullArgument(expression, "expression"); try { final org.jaxen.XPath xpath = newXPath(node, expression, resolver); return xpath.numberValueOf(node).doubleValue(); } catch (final JaxenException e) { throw new DomBindingException(expression, e); } }