@Override public void setIndex(int index) { if (this.index == index) { return; } // When dealing with a scalar, index == 0 is equivalent to // WHOLE_COLLECTION, so do not change it. if (this.index != WHOLE_COLLECTION || index != 0 || isCollection()) { super.setIndex(index); value = UNINITIALIZED; } }
@Override public void setIndex(int index) { if (this.index == index) { return; } // When dealing with a scalar, index == 0 is equivalent to // WHOLE_COLLECTION, so do not change it. if (this.index != WHOLE_COLLECTION || index != 0 || isCollection()) { super.setIndex(index); value = UNINITIALIZED; } }
@Override public void remove() { if (index == WHOLE_COLLECTION) { setValue(null); } else if (isCollection()) { Object o = getBaseValue(); Object collection = ValueUtils.remove(getBaseValue(), index); if (collection != o) { ValueUtils.setValue(getBean(), getPropertyDescriptor(), collection); } } else if (index == 0) { index = WHOLE_COLLECTION; setValue(null); } }
@Override public void remove() { if (index == WHOLE_COLLECTION) { setValue(null); } else if (isCollection()) { Object o = getBaseValue(); Object collection = ValueUtils.remove(getBaseValue(), index); if (collection != o) { ValueUtils.setValue(getBean(), getPropertyDescriptor(), collection); } } else if (index == 0) { index = WHOLE_COLLECTION; setValue(null); } }