@Autowired
private JexlUtil jexlUtil;
private AbstractDerSchema populate(final AbstractDerSchema derSchema, final DerivedSchemaTO derSchemaTO) {
SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
if (derSchemaTO.getExpression() == null) {
SyncopeClientException requiredValuesMissing = new SyncopeClientException(
SyncopeClientExceptionType.RequiredValuesMissing);
requiredValuesMissing.addElement("expression");
scce.addException(requiredValuesMissing);
}
if (!jexlUtil.isExpressionValid(derSchemaTO.getExpression())) {
SyncopeClientException invalidMandatoryCondition = new SyncopeClientException(
SyncopeClientExceptionType.InvalidValues);
invalidMandatoryCondition.addElement(derSchemaTO.getExpression());
scce.addException(invalidMandatoryCondition);
}
if (scce.hasExceptions()) {
throw scce;
}
BeanUtils.copyProperties(derSchemaTO, derSchema);