@Override public String asPath() { if (!byNameAttribute) { return super.asPath(); } StringBuffer buffer = new StringBuffer(); buffer.append(getImmediateParentPointer().asPath()); buffer.append("[@name='"); buffer.append(escape(getPropertyName())); buffer.append("']"); if (index != WHOLE_COLLECTION) { buffer.append('[').append(index + 1).append(']'); } return buffer.toString(); }
@Override public String asPath() { if (!byNameAttribute) { return super.asPath(); } StringBuilder buffer = new StringBuilder(); buffer.append(getImmediateParentPointer().asPath()); buffer.append("[@name='"); buffer.append(escape(getPropertyName())); buffer.append("']"); if (index != WHOLE_COLLECTION) { buffer.append('[').append(index + 1).append(']'); } return buffer.toString(); }
@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; }