use of org.jowidgets.util.collection.IObserverSet in project jo-client-platform by jo-source.
the class BeanProxyImpl method getPropertiesListeners.
@SuppressWarnings({ "rawtypes", "unchecked" })
private <PROPERTY_TYPE> IObserverSet<ICustomBeanPropertyListener<BEAN_TYPE, Object>> getPropertiesListeners(final ITypedKey<PROPERTY_TYPE> key) {
Assert.paramNotNull(key, "key");
IObserverSet result = customPropertiesListeners.get(key);
if (result == null) {
result = ObserverSetFactory.create(IObserverSetFactory.Strategy.LOW_MEMORY);
customPropertiesListeners.put(key, result);
}
return result;
}
use of org.jowidgets.util.collection.IObserverSet in project jo-client-platform by jo-source.
the class BeanProxyImpl method clearValidationResults.
private void clearValidationResults() {
final boolean hasResults = independentWorstResult.get() != null || validationResults.size() > 0;
if (hasResults) {
if (independentWorstResult.get() != null) {
for (final Entry<String, IObserverSet<IExternalBeanValidator>> entry : externalValidators.entrySet()) {
final IBeanValidationResult okResult = BeanValidationResult.create(entry.getKey(), ValidationResult.ok());
for (final IExternalBeanValidator externalValidator : entry.getValue()) {
externalValidator.validate(Collections.singletonList(okResult));
}
}
} else {
for (final String propertyName : validationResults.keySet()) {
final IBeanValidationResult okResult = BeanValidationResult.create(propertyName, ValidationResult.ok());
for (final IExternalBeanValidator externalValidator : getRegisteredExternalValidators(propertyName)) {
externalValidator.validate(Collections.singletonList(okResult));
}
}
}
independentWorstResult.set(null);
validationResults.clear();
fireValidationConditionsChanged();
}
}
Aggregations