/** * Get the context item * @return the context item, or null if the context item is undefined */ public final Item getContextItem() { if (currentIterator==null) { return null; } return currentIterator.current(); }
/** * Get the context item * @return the context item, or null if the context item is undefined */ public final Item getContextItem() { if (currentIterator==null) { return null; } return currentIterator.current(); }
/** * Get the context item * @return the context item, or null if the context item is undefined */ public final Item getContextItem() { if (currentIterator==null) { return null; } return currentIterator.current(); }
/** * Get the current value in the sequence (the one returned by the * most recent call on next()). This will be null before the first * call of next(). This method does not change the state of the iterator. * * @return the current item, the one most recently returned by a call on * next(). Returns null if next() has not been called, or if the end * of the sequence has been reached. * @since 8.4 */ public Item current() { return base.current(); }
public Item current() { return currentIterator.current(); }
public Item current() { return base.current(); }
public Item current() { return base.current(); }
public Item current() { return currentIterator.current(); }
public Item current() { return base.current(); }
public Item current() { return base.current(); }
public Item current() { return base.current(); }
public Item current() { return base.current(); }
public Item current() { return base.current(); }
/** * Get an atomic value. This call may be used only when the last event reported was * ATOMIC_VALUE. This indicates that the PullProvider is reading a sequence that contains * a free-standing atomic value; it is never used when reading the content of a node. */ public AtomicValue getAtomicValue() { if (currentEvent == ATOMIC_VALUE) { return (AtomicValue)base.current(); } else { throw new IllegalStateException(); } }
/** * Get an atomic value. This call may be used only when the last event reported was * ATOMIC_VALUE. This indicates that the PullProvider is reading a sequence that contains * a free-standing atomic value; it is never used when reading the content of a node. */ public AtomicValue getAtomicValue() { if (currentEvent == ATOMIC_VALUE) { return (AtomicValue)base.current(); } else { throw new IllegalStateException(); } }
/** * Return the line number of the context node. * * @param c the XPath dynamic context * @return the line number, or -1 if not available */ public static int lineNumber(XPathContext c) { Item item = c.getCurrentIterator().current(); if (item instanceof NodeInfo) { return ((NodeInfo)item).getLineNumber(); } else { return -1; } }
/** * Return the column number of the context node. This is only * available if line numbering has been enabled for the containing tree * * @param c the XPath dynamic context * @return the column number, or -1 if not available */ public static int columnNumber(XPathContext c) { Item item = c.getCurrentIterator().current(); if (item instanceof NodeInfo) { return ((NodeInfo)item).getColumnNumber(); } else { return -1; } }
/** * Return the line number of the context node. * * @param c the XPath dynamic context * @return the line number, or -1 if not available */ public static int lineNumber(XPathContext c) { Item item = c.getCurrentIterator().current(); if (item instanceof NodeInfo) { return ((NodeInfo)item).getLineNumber(); } else { return -1; } }
/** * Locates the equivalent JAXP function * * @param context context * @param name name * * @return type */ private static XPathFunction resolveFunction(XPathContext context, QName name) { JaxpFunctionResolver funcResolver = null; Item item = context.getCurrentIterator().current(); if (item instanceof NodeWrapper) { Node node = (Node) ((NodeWrapper) item).getUnderlyingNode(); if (node != null) { funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER); } } return funcResolver.resolveFunction(name, 0); }
@Override public Sequence call(XPathContext ctx, Sequence[] secs) throws XPathException { if (secs.length == 0) { throw new XPathException("Missing argument"); } else { StringBuilder buf = new StringBuilder(); for (Sequence seq : secs) { SequenceIterator<? extends Item> iter = seq.iterate(); while (iter.next() != null) { buf.append(iter.current().getStringValue()); } } return new StringValue(buf.toString()); } } };