public static Item convertXQItem(XQItem xqItem, Configuration config) throws XQException, XPathException { BuiltInAtomicType type = getAtomicType(xqItem.getItemType()); if (type == null) { return convertToItem(xqItem.getObject(), config, xqItem.getItemType().getItemKind()); } return convertToAtomicItem(xqItem.getObject(), config, type); }
valType = ((XQItem) value).getItemType().getBaseType(); value = ((XQItem) value).getObject(); } catch (XQException ex) {
@Override public XQItem createItem(XQItem item) throws XQException { checkState(ex_connection_closed); if (item == null) { throw new XQException("Item is null"); } if (item.isClosed()) { throw new XQException("Item is closed"); } return new BagriXQItem(xqProcessor, item.getItemType(), item.getAtomicValue()); }
private void setCurrent() throws XQException { // TODO: construct XQItemType properly..? if (position > 0 && position <= sequence.size()) { Object current = sequence.get(position - 1); if (current instanceof XQItem) { XQItem item = (XQItem) current; setCurrent(item.getItemType(), item.getObject()); } else if (current instanceof XQSequence) { XQSequence sequence = (XQSequence) current; if (!sequence.isOnItem()) { sequence.first(); } setCurrent(sequence.getItemType(), sequence); } else { setCurrent(XQUtils.getTypeForObject(xqFactory, current), current); } } else { setCurrent(null, null); } }
XQItemType itemType = item.getItemType(); Object itemValue = null;
@Override public void write(ObjectDataOutput out, XQItem item) throws IOException { try { XQItemType type = item.getItemType(); out.writeObject(type); logger.trace("write; got type: {}", type);