public Sequence<?> convert(Object object, XPathContext context) throws XPathException { List<Item<?>> list = new ArrayList<>(((Collection) object).size()); int a = 0; for (Object obj : (Collection) object) { JPConverter itemConverter = allocate(obj.getClass(), null, context.getConfiguration()); try { Item<?> item = SequenceTool.asItem(itemConverter.convert(obj, context)); if (item != null) { list.add(item); } } catch (XPathException e) { throw new XPathException( "Returned Collection contains an object that cannot be converted to an Item (" + obj.getClass() + "): " + e.getMessage(), SaxonErrorCode.SXJE0051); } } return new SequenceExtent<>(list); }
public Sequence<?> convert(Object object, XPathContext context) throws XPathException { List<Item<?>> list = new ArrayList<>(((Collection) object).size()); int a = 0; for (Object obj : (Collection) object) { JPConverter itemConverter = allocate(obj.getClass(), null, context.getConfiguration()); try { Item<?> item = SequenceTool.asItem(itemConverter.convert(obj, context)); if (item != null) { list.add(item); } } catch (XPathException e) { throw new XPathException( "Returned Collection contains an object that cannot be converted to an Item (" + obj.getClass() + "): " + e.getMessage(), SaxonErrorCode.SXJE0051); } } return new SequenceExtent<>(list); }
public Sequence<?> convert(Object object, XPathContext context) throws XPathException { Object[] arrayObject = (Object[]) object; List<Item<?>> newArray = new ArrayList<>(arrayObject.length); int a = 0; for (Object member : arrayObject) { if (member != null) { try { Item<?> newItem = SequenceTool.asItem(itemConverter.convert(member, context)); if (newItem != null) { newArray.add(newItem); } } catch (XPathException e) { throw new XPathException( "Returned array contains an object that cannot be converted to an Item (" + member.getClass() + "): " + e.getMessage(), SaxonErrorCode.SXJE0051); } } else { throw new XPathException("Returned array contains null values: cannot convert to items", SaxonErrorCode.SXJE0051); } } return new SequenceExtent<>(newArray); }
public Sequence<?> convert(Object object, XPathContext context) throws XPathException { Object[] arrayObject = (Object[]) object; List<Item<?>> newArray = new ArrayList<>(arrayObject.length); int a = 0; for (Object member : arrayObject) { if (member != null) { try { Item<?> newItem = SequenceTool.asItem(itemConverter.convert(member, context)); if (newItem != null) { newArray.add(newItem); } } catch (XPathException e) { throw new XPathException( "Returned array contains an object that cannot be converted to an Item (" + member.getClass() + "): " + e.getMessage(), SaxonErrorCode.SXJE0051); } } else { throw new XPathException("Returned array contains null values: cannot convert to items", SaxonErrorCode.SXJE0051); } } return new SequenceExtent<>(newArray); }
return SequenceTool.asItem(jp.convert(value, new EarlyEvaluationContext(config))); } else if (value instanceof Source) { return sourceToNode((Source) value, config);