public NodePointer createPath(JXPathContext context) { if (getImmediateNode() == null) { AbstractFactory factory = getAbstractFactory(context); int inx = (index == WHOLE_COLLECTION ? 0 : index); boolean success = factory.createObject( context, this, getBean(), getPropertyName(), inx); if (!success) { throw new JXPathAbstractFactoryException("Factory " + factory + " could not create an object for path: " + asPath()); } } return this; }
public NodePointer createPath(JXPathContext context) { if (!actual) { AbstractFactory factory = getAbstractFactory(context); if (!factory.declareVariable(context, name.toString())) { throw new JXPathAbstractFactoryException( "Factory cannot define variable '" + name + "' for path: " + asPath()); } findVariables(context); // Assert: actual == true } return this; }
@Override public NodePointer createPath(JXPathContext context) { if (getImmediateNode() == null) { AbstractFactory factory = getAbstractFactory(context); int inx = (index == WHOLE_COLLECTION ? 0 : index); boolean success = factory.createObject( context, this, getBean(), getPropertyName(), inx); if (!success) { throw new JXPathAbstractFactoryException("Factory " + factory + " could not create an object for path: " + asPath()); } } return this; }
@Override public NodePointer createPath(JXPathContext context) { if (getImmediateNode() == null) { AbstractFactory factory = getAbstractFactory(context); int inx = (index == WHOLE_COLLECTION ? 0 : index); boolean success = factory.createObject( context, this, getBean(), getPropertyName(), inx); if (!success) { throw new JXPathAbstractFactoryException("Factory " + factory + " could not create an object for path: " + asPath()); } } return this; }
public NodePointer createChild( JXPathContext context, QName name, int index) { Object collection = createCollection(context, index); if (!isActual() || (index != 0 && index != WHOLE_COLLECTION)) { AbstractFactory factory = getAbstractFactory(context); boolean success = factory.createObject( context, this, collection, getName().toString(), index); if (!success) { throw new JXPathAbstractFactoryException( "Factory could not create object path: " + asPath()); } NodePointer cln = (NodePointer) clone(); cln.setIndex(index); return cln; } return this; }
public NodePointer createChild(JXPathContext context, QName name, int index) { if (index == WHOLE_COLLECTION) { index = 0; } boolean success = getAbstractFactory(context).createObject( context, this, node, name.toString(), index); if (success) { NodeTest nodeTest; String prefix = name.getPrefix(); String namespaceURI = prefix == null ? null : context .getNamespaceURI(prefix); nodeTest = new NodeNameTest(name, namespaceURI); NodeIterator it = childIterator(nodeTest, false, null); if (it != null && it.setPosition(index + 1)) { return it.getNodePointer(); } } throw new JXPathAbstractFactoryException( "Factory could not create a child node for path: " + asPath() + "/" + name + "[" + (index + 1) + "]"); }
public NodePointer createChild( JXPathContext context, QName name, int index) { if (index == WHOLE_COLLECTION) { index = 0; } boolean success = getAbstractFactory(context).createObject( context, this, node, name.toString(), index); if (success) { NodeTest nodeTest; String prefix = name.getPrefix(); String namespaceURI = prefix == null ? null : context .getNamespaceURI(prefix); nodeTest = new NodeNameTest(name, namespaceURI); NodeIterator it = childIterator(nodeTest, false, null); if (it != null && it.setPosition(index + 1)) { return it.getNodePointer(); } } throw new JXPathAbstractFactoryException("Factory could not create " + "a child node for path: " + asPath() + "/" + name + "[" + (index + 1) + "]"); }
public NodePointer createPath(JXPathContext context) { // Ignore the name passed to us, use our own data Object collection = getBaseValue(); if (collection == null) { AbstractFactory factory = getAbstractFactory(context); boolean success = factory.createObject( context, this, getBean(), getPropertyName(), 0); if (!success) { throw new JXPathAbstractFactoryException( "Factory could not create an object for path: " + asPath()); } collection = getBaseValue(); } if (index != WHOLE_COLLECTION) { if (index < 0) { throw new JXPathInvalidAccessException("Index is less than 1: " + asPath()); } if (index >= getLength()) { collection = ValueUtils.expandCollection(collection, index + 1); handler.setProperty(getBean(), getPropertyName(), collection); } } return this; }