/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public void addToValue(Object target, Object value) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { Collection<Object> mapValue = getValue(target); if (mapValue == null) { mapValue = new ArrayList<>(); } // target instance must be tested to avoid triggering twice the property // processors if the map contains a non-map model. if (target instanceof Map<?, ?> && getModelDescriptor() != null) { getModelDescriptor().preprocessAdder(this, mapValue, value); } mapValue.add(value); // to trigger a propertyChange. setValue(target, mapValue); // target instance must be tested to avoid triggering twice the property // processors if the map contains a non-map model. if (target instanceof Map<?, ?> && getModelDescriptor() != null) { getModelDescriptor().postprocessAdder(this, mapValue, value); } }
doFirePropertyChange(proxy, propertyName, oldCollectionSnapshot, collectionProperty); if (propertyProcessorsEnabled) { propertyDescriptor.postprocessAdder(proxy, collectionProperty, value);
break; case ADDER: ((ICollectionPropertyDescriptor<?>) propertyDescriptor).postprocessAdder(proxy, (Collection<Object>) newComputedPropertyValue, args[args.length - 1]); break;