XPathFunction provides access to XPath functions.
XPathFunction
Functions are identified by QName and arity in XPath.
582583584585586587588589590591592
this.propertiesFunction = propertiesFunction; } public XPathFunction getSimpleFunction() { if (simpleFunction == null) { simpleFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange != null && !list.isEmpty()) { Object value = list.get(0); if (value != null) { String text = exchange.get().getContext().getTypeConverter().convertTo(String.class, value);
858859860861862863864865866867868
} protected XPathFunctionResolver createDefaultFunctionResolver(final XPathFunctionResolver parent) { return new XPathFunctionResolver() { public XPathFunction resolveFunction(QName qName, int argumentCount) { XPathFunction answer = null; if (parent != null) { answer = parent.resolveFunction(qName, argumentCount); } if (answer == null) { if (isMatchingNamespaceOrEmptyNamespace(qName.getNamespaceURI(), IN_NAMESPACE)
439440441442443444445446447448449
getNamespaceContext().setNamespaces(namespaces); } public XPathFunction getBodyFunction() { if (bodyFunction == null) { bodyFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange == null) { return null; } return exchange.get().getIn().getBody();
457458459460461462463464465466467
this.bodyFunction = bodyFunction; } public XPathFunction getHeaderFunction() { if (headerFunction == null) { headerFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange != null && !list.isEmpty()) { Object value = list.get(0); if (value != null) { return exchange.get().getIn().getHeader(value.toString());
478479480481482483484485486487488
this.headerFunction = headerFunction; } public XPathFunction getOutBodyFunction() { if (outBodyFunction == null) { outBodyFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange.get() != null && exchange.get().hasOut()) { return exchange.get().getOut().getBody(); } return null;
496497498499500501502503504505506
this.outBodyFunction = outBodyFunction; } public XPathFunction getOutHeaderFunction() { if (outHeaderFunction == null) { outHeaderFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange.get() != null && !list.isEmpty()) { Object value = list.get(0); if (value != null) { return exchange.get().getOut().getHeader(value.toString());
652653654655656657658659660661662
436437438439440441442443444445446
454455456457458459460461462463464
this.bodyFunction = bodyFunction; } public XPathFunction getHeaderFunction() { if (headerFunction == null) { headerFunction = new XPathFunction() { public Object evaluate(List list) throws XPathFunctionException { if (exchange != null && !list.isEmpty()) { Object value = list.get(0); if (value != null) { String text = exchange.get().getContext().getTypeConverter().convertTo(String.class, value);
476477478479480481482483484485486