use of org.jowidgets.validation.IValidationResultBuilder in project jo-client-platform by jo-source.
the class BeansStateTrackerImpl method createValidationResult.
@Override
public IValidationResult createValidationResult() {
final IValidationResultBuilder builder = ValidationResult.builder();
for (final IBeanProxy<BEAN_TYPE> bean : new LinkedList<IBeanProxy<BEAN_TYPE>>(validationDirtyBeans)) {
final IValidationResult validationResult = bean.validate();
builder.addResult(validationResult);
if (validationResult.isOk()) {
validationDirtyBeans.remove(bean);
} else if (!validationResult.isValid()) {
break;
}
}
return builder.build();
}
use of org.jowidgets.validation.IValidationResultBuilder in project jo-client-platform by jo-source.
the class AttributesBeanPropertyValidator method validatePropertyImpl.
private IValidationResult validatePropertyImpl(final IBeanProxy<BEAN_TYPE> bean, final String propertyName) {
final IValidationResultBuilder builder = ValidationResult.builder();
final IValidator<Object> validator = validators.get(propertyName);
if (validator != null) {
final IValidationResult validationResult = validator.validate(bean.getValue(propertyName));
if (!validationResult.isValid()) {
return validationResult;
} else if (!validationResult.isOk()) {
builder.addResult(validationResult);
}
}
return builder.build();
}
use of org.jowidgets.validation.IValidationResultBuilder in project jo-client-platform by jo-source.
the class BeanRelationTreeModelImpl method createValidationResult.
@Override
public IValidationResult createValidationResult() {
final IValidationResultBuilder builder = ValidationResult.builder();
builder.addResult(root.validate());
for (final Object relationModelObject : relationNodes.values()) {
final IBeanRelationNodeModel<?, ?> relationModel = (IBeanRelationNodeModel<?, ?>) relationModelObject;
builder.addResult(relationModel.validate());
}
for (final IDataModel dataModel : externalDataModels) {
builder.addResult(dataModel.validate());
}
return builder.build();
}
use of org.jowidgets.validation.IValidationResultBuilder in project jo-client-platform by jo-source.
the class BeanProxyImpl method createValidationResult.
@Override
public IValidationResult createValidationResult() {
checkDisposed();
final IValidationResultBuilder builder = ValidationResult.builder();
final IValidationResult independentResult = independentWorstResult.get();
if (independentResult != null && !independentResult.isValid()) {
return independentResult;
}
for (final IValidationResult validationResult : validationResults.values()) {
if (!validationResult.isValid()) {
return validationResult;
} else {
builder.addResult(validationResult);
}
}
return builder.build();
}
Aggregations