@Override public void dispatchValueChanged(Object data, Object originalSource, Property prop, Object oldValue, Object newValue) { BaseMediator.this.dispatchValueChanged(prop, oldValue, newValue); } };
/** * get the data consumer. * @return the data consumer * @since 1.1.2 */ public DataConsumer<? super T> getDataConsumer() { return mediator._getDataConsumer(); }
/** * get the equals comparator. * * @return the equals comparator. * @since 1.1.2 */ public EqualsComparator getEqualsComparator() { return mediator._getEqualsComparator(); }
@Override public void onRemovePropertyValues(Object data, Property prop, Object newValue, Object removeValue) { final DataMediator root = provideRootDataMediator(prop); if(root == null){ return; } params.mOriginalSource = data; params.receiver = root.getBaseMediator()._getInternalDispatcher(); depthReceiver.onPreCallback(params); depthReceiver.dispatchOnRemovePropertyValues(root.getData(), data, prop, newValue, removeValue); depthReceiver.onPostCallback(); } @Override
/** * get the exact module data. * @return the module data. */ public final T getData(){ return getBaseMediator()._getTarget(); } /**
/** * remove the key-value by target key. * @param key the key * @return this */ public SparseArrayPropertyEditor<D, V> remove(int key){ final V value = mMap.remove(key); if(value != null && mMediator != null){ mMediator._getSparseArrayDispatcher().dispatchRemoveEntry(mProperty, key ,value); } return this; }
/** * set the data consumer * @param mConsumer the data consumer * @since 1.1.2 */ public void setDataConsumer(DataConsumer<? super T> mConsumer) { mediator._setDataConsumer(mConsumer); }
/** * get the property interceptor , default is {@linkplain PropertyInterceptor#NULL} * @return the property interceptor. * @since 1.1.3 */ public PropertyInterceptor getPropertyInterceptor() { return mediator._getPropertyInterceptor(); }
/** * set the property interceptor . default is {@linkplain PropertyInterceptor#NULL} * @param interceptor the target property interceptor. * @since 1.1.3 */ public void setPropertyInterceptor(PropertyInterceptor interceptor) { mediator._setPropertyInterceptor(interceptor); }
/** * set the equals comparator which is used to judge the different between the old value and new value. * default is {@linkplain com.heaven7.java.data.mediator.util.DefaultEqualsComparator}. * @param comparator the equals comparator */ public void setEqualsComparator(EqualsComparator comparator) { mediator._setEqualsComparator(comparator); }
@Override public void onPropertyItemChanged(Object data, Property prop, Object oldItem, Object newItem, int index) { final DataMediator root = provideRootDataMediator(prop); if(root == null){ return; } params.mOriginalSource = data; params.receiver = root.getBaseMediator()._getInternalDispatcher(); depthReceiver.onPreCallback(params); depthReceiver.dispatchOnPropertyItemChanged(root.getData(), data, prop, oldItem, newItem, index); depthReceiver.onPostCallback(); } }
/** * get the exact module data. * @return the module data. */ public final T getData(){ return getBaseMediator()._getTarget(); } /**
/** * remove the key-value by target key. * @param key the key * @return this */ public SparseArrayPropertyEditor<D, V> remove(int key){ final V value = mMap.remove(key); if(value != null && mMediator != null){ mMediator._getSparseArrayDispatcher().dispatchRemoveEntry(mProperty, key ,value); } return this; }
/** * set the data consumer * @param mConsumer the data consumer * @since 1.1.2 */ public void setDataConsumer(DataConsumer<? super T> mConsumer) { mediator._setDataConsumer(mConsumer); }
/** * get the property interceptor , default is {@linkplain PropertyInterceptor#NULL} * @return the property interceptor. * @since 1.1.3 */ public PropertyInterceptor getPropertyInterceptor() { return mediator._getPropertyInterceptor(); }
/** * set the property interceptor . default is {@linkplain PropertyInterceptor#NULL} * @param interceptor the target property interceptor. * @since 1.1.3 */ public void setPropertyInterceptor(PropertyInterceptor interceptor) { mediator._setPropertyInterceptor(interceptor); }
/** * set the equals comparator which is used to judge the different between the old value and new value. * default is {@linkplain com.heaven7.java.data.mediator.util.DefaultEqualsComparator}. * @param comparator the equals comparator */ public void setEqualsComparator(EqualsComparator comparator) { mediator._setEqualsComparator(comparator); }
@Override public void dispatchValueChanged(Object data, Object originalSource, Property prop, Object oldValue, Object newValue) { BaseMediator.this.dispatchValueChanged(prop, oldValue, newValue); } };
@Override public void onAddPropertyValues(Object data, Property prop, Object newValue, Object addedValue) { final DataMediator root = provideRootDataMediator(prop); if(root == null){ return; } params.mOriginalSource = data; params.receiver = root.getBaseMediator()._getInternalDispatcher(); depthReceiver.onPreCallback(params); depthReceiver.dispatchOnAddPropertyValues(root.getData(), data, prop, newValue, addedValue); depthReceiver.onPostCallback(); } @Override
/** * add property with it's value. * @param prop the property * @param value the value of property * @return this. */ public BatchApplier addProperty(Property prop, Object value) { Throwables.checkNull(prop); if(!mInterceptor.shouldIntercept(mMediator._getTarget(), prop, value)) { this.mProps.add(prop); this.mValue.add(value); } return this; }