@Override public NodePointer createPath(JXPathContext context, Object value) { NodePointer newParent = parent.createPath(context); if (isAttribute()) { NodePointer pointer = newParent.createAttribute(context, getName()); pointer.setValue(value); return pointer; } if (parent instanceof NullPointer && parent.equals(newParent)) { throw createBadFactoryException(context.getFactory()); } if (newParent instanceof EStructuralFeatureOwnerPointer) { EStructuralFeatureOwnerPointer pop = (EStructuralFeatureOwnerPointer) newParent; newParent = pop.getPropertyPointer(); } return newParent.createChild(context, getName(), index, value); }
@Override public NodePointer createPath(JXPathContext context, Object value) { NodePointer newParent = parent.createPath(context); if (isAttribute()) { NodePointer pointer = newParent.createAttribute(context, getName()); pointer.setValue(value); return pointer; } if (parent instanceof NullPointer && parent.equals(newParent)) { throw createBadFactoryException(context.getFactory()); } if (newParent instanceof EStructuralFeatureOwnerPointer) { EStructuralFeatureOwnerPointer pop = (EStructuralFeatureOwnerPointer) newParent; newParent = pop.getPropertyPointer(); } return newParent.createChild(context, getName(), index, value); }
@Override public NodePointer createPath(JXPathContext context) { NodePointer newParent = parent.createPath(context); if (isAttribute()) { return newParent.createAttribute(context, getName()); } if (parent instanceof NullPointer && parent.equals(newParent)) { throw createBadFactoryException(context.getFactory()); } // Consider these two use cases: // 1. The parent pointer of NullPropertyPointer is // a PropertyOwnerPointer other than NullPointer. When we call // createPath on it, it most likely returns itself. We then // take a PropertyPointer from it and get the PropertyPointer // to expand the collection for the corresponding property. // // 2. The parent pointer of NullPropertyPointer is a NullPointer. // When we call createPath, it may return a PropertyOwnerPointer // or it may return anything else, like a DOMNodePointer. // In the former case we need to do exactly what we did in use // case 1. In the latter case, we simply request that the // non-property pointer expand the collection by itself. if (newParent instanceof EStructuralFeatureOwnerPointer) { EStructuralFeatureOwnerPointer pop = (EStructuralFeatureOwnerPointer) newParent; newParent = pop.getPropertyPointer(); } return newParent.createChild(context, getName(), getIndex()); }
@Override public NodePointer createPath(JXPathContext context) { NodePointer newParent = parent.createPath(context); if (isAttribute()) { return newParent.createAttribute(context, getName()); } if (parent instanceof NullPointer && parent.equals(newParent)) { throw createBadFactoryException(context.getFactory()); } // Consider these two use cases: // 1. The parent pointer of NullPropertyPointer is // a PropertyOwnerPointer other than NullPointer. When we call // createPath on it, it most likely returns itself. We then // take a PropertyPointer from it and get the PropertyPointer // to expand the collection for the corresponding property. // // 2. The parent pointer of NullPropertyPointer is a NullPointer. // When we call createPath, it may return a PropertyOwnerPointer // or it may return anything else, like a DOMNodePointer. // In the former case we need to do exactly what we did in use // case 1. In the latter case, we simply request that the // non-property pointer expand the collection by itself. if (newParent instanceof EStructuralFeatureOwnerPointer) { EStructuralFeatureOwnerPointer pop = (EStructuralFeatureOwnerPointer) newParent; newParent = pop.getPropertyPointer(); } return newParent.createChild(context, getName(), getIndex()); }
NodePointer startWith) { propertyNodePointer = (EStructuralFeaturePointer) pointer.getPropertyPointer().clone(); this.name = name; this.reverse = reverse;
NodePointer startWith) { propertyNodePointer = (EStructuralFeaturePointer) pointer.getPropertyPointer().clone(); this.name = name; this.reverse = reverse;
@Override public void setValue(Object value) { if (parent == null || parent.isContainer()) { throw new JXPathInvalidAccessException( "Cannot set property " + asPath() + ", the target object is null"); } if (parent instanceof EStructuralFeatureOwnerPointer && ((EStructuralFeatureOwnerPointer) parent) .isDynamicPropertyDeclarationSupported()) { // If the parent property owner can create // a property automatically - let it do so EStructuralFeaturePointer propertyPointer = ((EStructuralFeatureOwnerPointer) parent).getPropertyPointer(); propertyPointer.setPropertyName(propertyName); propertyPointer.setValue(value); } else { throw new JXPathInvalidAccessException( "Cannot set property " + asPath() + ", path does not match a changeable location"); } }
@Override public void setValue(Object value) { if (parent == null || parent.isContainer()) { throw new JXPathInvalidAccessException( "Cannot set property " + asPath() + ", the target object is null"); } if (parent instanceof EStructuralFeatureOwnerPointer && ((EStructuralFeatureOwnerPointer) parent) .isDynamicPropertyDeclarationSupported()) { // If the parent property owner can create // a property automatically - let it do so EStructuralFeaturePointer propertyPointer = ((EStructuralFeatureOwnerPointer) parent).getPropertyPointer(); propertyPointer.setPropertyName(propertyName); propertyPointer.setValue(value); } else { throw new JXPathInvalidAccessException( "Cannot set property " + asPath() + ", path does not match a changeable location"); } }