use of com.agiletec.aps.system.common.entity.model.AttributeTracer in project entando-core by entando.
the class CompositeAttribute method validate.
@Override
public List<AttributeFieldError> validate(AttributeTracer tracer) {
List<AttributeFieldError> errors = super.validate(tracer);
try {
List<AttributeInterface> attributes = this.getAttributes();
for (int i = 0; i < attributes.size(); i++) {
AttributeInterface attributeElement = attributes.get(i);
AttributeTracer elementTracer = tracer.clone();
elementTracer.setCompositeElement(true);
elementTracer.setParentAttribute(this);
List<AttributeFieldError> elementErrors = attributeElement.validate(elementTracer);
if (null != elementErrors) {
errors.addAll(elementErrors);
}
}
} catch (Throwable t) {
_logger.error("Error validating composite attribute", t);
throw new RuntimeException("Error validating composite attribute", t);
}
return errors;
}
Aggregations