List of usage examples for org.apache.commons.jxpath JXPathInvalidAccessException JXPathInvalidAccessException
public JXPathInvalidAccessException(String message)
From source file:org.eclipse.e4.emf.internal.xpath.EObjectPropertyPointer.java
/** * If index == WHOLE_COLLECTION, change the value of the property, otherwise * change the value of the index'th element of the collection * represented by the property./*from w w w . j a va2s. c o m*/ * @param value value to set */ @Override public void setValue(Object value) { EStructuralFeature pd = getPropertyDescriptor(); if (pd == null) { throw new JXPathInvalidAccessException("Cannot set property: " + asPath() + " - no such property"); } if (index == WHOLE_COLLECTION) { ValueUtils.setValue(getBean(), pd, value); } else { ValueUtils.setValue(getBean(), pd, index, value); } this.value = value; }
From source file:org.eclipse.e4.emf.internal.xpath.EStructuralFeatureOwnerPointer.java
/** * Throws an exception if you try to change the root element, otherwise * forwards the call to the parent pointer. * @param value to set/* w w w. j a v a 2 s . c o m*/ */ @Override public void setValue(Object value) { this.value = value; if (parent != null) { if (parent.isContainer()) { parent.setValue(value); } else { if (index == WHOLE_COLLECTION) { throw new UnsupportedOperationException( "Cannot setValue of an object that is not " + "some other object's property"); } throw new JXPathInvalidAccessException("The specified collection element does not exist: " + this); } } else { throw new UnsupportedOperationException("Cannot replace the root object"); } }
From source file:org.eclipse.e4.emf.internal.xpath.NullEStructuralFeaturePointer.java
@Override public void setValue(Object value) { if (parent == null || parent.isContainer()) { throw new JXPathInvalidAccessException( "Cannot set property " + asPath() + ", the target object is null"); }//w w w . j a v a2s . c om 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"); } }