@Override public List<Node> mapResults(XQResultSequence result) { List<Node> results = new ArrayList<Node>(); try { while(result.next()) { XQItemType type = result.getItemType(); if(isNodeType(type)) { Node n = result.getNode(); results.add(n); } } } catch (Exception e) { throw new MessagingException("Caught Exception while mapping the result sequence to string",e); } return results; }
@Override public List<Number> mapResults(XQResultSequence result) { List<Number> results = new ArrayList<Number>(); try { while(result.next()) { XQItemType type = result.getItemType(); Number value = convertToNumber(type, result); if(value == null && isNodeType(type)) { Node n = result.getNode(); String strValue = transformNodeToString(n); if(StringUtils.hasText(strValue)) { if(strValue.indexOf('.') > 0) { value = Double.valueOf(strValue); } else { value = Long.valueOf(strValue); } } } results.add(value); } } catch (Exception e) { throw new MessagingException("Caught Exception while mapping the result sequence to string",e); } return results; }
@Override public List<Boolean> mapResults(XQResultSequence result) { List<Boolean> results = new ArrayList<Boolean>(); try { //check for boolean or string type and convert it accordingly, if a node then get it's text //content and convert to boolean while(result.next()) { XQItemType type = result.getItemType(); Boolean value = convertToBoolean(type, result); if(value == null && isNodeType(type)) { Node n = result.getNode(); value = Boolean.valueOf(transformNodeToString(n)); } results.add(value); } } catch (Exception e) { throw new MessagingException("Caught Exception while mapping the result sequence to string",e); } return results; }
try { while(result.next()) { XQItemType type = result.getItemType(); String value = convertToString(type, result); if(value == null) {