@Override public NodePointer createPath(JXPathContext context, Object value) { // If neccessary, expand collection if (index != WHOLE_COLLECTION && index >= getLength()) { createPath(context); } setValue(value); return this; }
@Override public NodePointer createPath(JXPathContext context, Object value) { // If neccessary, expand collection if (index != WHOLE_COLLECTION && index >= getLength()) { createPath(context); } setValue(value); return this; }
@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"); } }