/** * For an intermediate pointer (e.g. PropertyPointer, ContainerPointer) * returns a pointer for the contained value. * @param pointer input pointer * @return NodePointer */ private static NodePointer valuePointer(NodePointer pointer) { return pointer == null ? null : pointer.getValuePointer(); }
/** * Returns the object the pointer points to; does not convert it * to a "canonical" type. Opens containers, properties etc and returns * the ultimate contents. * @return Object node */ public Object getNode() { return getValuePointer().getImmediateNode(); }
/** * Returns a NodeIterator that iterates over all attributes of the current * node matching the supplied node name (could have a wildcard). * May return null if the object does not support the attributes. * @param qname the attribute name to test * @return NodeIterator */ public NodeIterator attributeIterator(QName qname) { NodePointer valuePointer = getValuePointer(); return valuePointer == null || valuePointer == this ? null : valuePointer.attributeIterator(qname); }
/** * Returns a NodeIterator that iterates over all children or all children * that match the given NodeTest, starting with the specified one. * @param test NodeTest to filter children * @param reverse specified iteration direction * @param startWith the NodePointer to start with * @return NodeIterator */ public NodeIterator childIterator( NodeTest test, boolean reverse, NodePointer startWith) { NodePointer valuePointer = getValuePointer(); return valuePointer == null || valuePointer == this ? null : valuePointer.childIterator(test, reverse, startWith); }
/** * If this pointer manages a transparent container, like a variable, * this method returns the pointer to the contents. * Only an auxiliary (non-node) pointer can (and should) return a * value pointer other than itself. * Note that you probably don't want to override * <code>getValuePointer()</code> directly. Override the * <code>getImmediateValuePointer()</code> method instead. The * <code>getValuePointer()</code> method is calls * <code>getImmediateValuePointer()</code> and, if the result is not * <code>this</code>, invokes <code>getValuePointer()</code> recursively. * The idea here is to open all nested containers. Let's say we have a * container within a container within a container. The * <code>getValuePointer()</code> method should then open all those * containers and return the pointer to the ultimate contents. It does so * with the above recursion. * @return NodePointer */ public NodePointer getValuePointer() { NodePointer ivp = getImmediateValuePointer(); return ivp == this ? this : ivp.getValuePointer(); }
public NodePointer createPath(JXPathContext context, Object value) { if (parent != null) { return parent.createPath(context, value).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
public NodePointer createPath(JXPathContext context) { if (parent != null) { return parent.createPath(context).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
@Override public NodePointer createPath(JXPathContext context, Object value) { if (parent != null) { return parent.createPath(context, value).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
@Override public NodePointer createPath(JXPathContext context) { if (parent != null) { return parent.createPath(context).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
@Override public NodePointer createPath(JXPathContext context, Object value) { if (parent != null) { return parent.createPath(context, value).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
@Override public NodePointer createPath(JXPathContext context) { if (parent != null) { return parent.createPath(context).getValuePointer(); } throw new UnsupportedOperationException( "Cannot create the root object: " + asPath()); }
/** * By default, returns <code>getNode()</code>, can be overridden to * return a "canonical" value, like for instance a DOM element should * return its string value. * @return Object value */ public Object getValue() { NodePointer valuePointer = getValuePointer(); if (valuePointer != this) { return valuePointer.getValue(); } // Default behavior is to return the same as getNode() return getNode(); }
return booleanValue(pointer.getNode()); pointer = pointer.getValuePointer(); return pointer.isActual();
for (int i = 0; i < length; i++) { ptr.setIndex(i); NodePointer elementPointer = ptr.getValuePointer(); NodeIterator iter = getElementNodeIterator(elementPointer);
for (int i = 0; i < length; i++) { ptr.setIndex(i); NodePointer elementPointer = ptr.getValuePointer(); NodeIterator iter = getElementNodeIterator(elementPointer);
for (int i = 0; i < length; i++) { ptr.setIndex(i); NodePointer elementPointer = ptr.getValuePointer(); NodeIterator iter = getElementNodeIterator(elementPointer);
/** * Used for an optimized access to dynamic properties using the * "map[@name = 'name']" syntax * @return whether valid */ private boolean setupDynamicPropertyPointer() { if (nameTestExpression == null) { return false; } NodePointer parent = parentContext.getCurrentNodePointer(); if (parent == null) { return false; } parent = parent.getValuePointer(); if (!(parent instanceof PropertyOwnerPointer)) { return false; } dynamicPropertyPointer = (PropertyPointer) ((PropertyOwnerPointer) parent) .getPropertyPointer() .clone(); return true; }
result = ((NodePointer) result).getValuePointer(); if (!isLenient() && !((NodePointer) result).isActual()) {