public InvalidPlainAttrValueException(final PlainAttrValue value, final Throwable cause) { this("Could not validate " + value.getValue(), cause); } }
objValues.add(value.getValue()); } else { if (schema instanceof PlainSchema) {
public InvalidPlainAttrValueException(final PlainAttrValue value) { this("Could not validate " + value.getValue()); }
@Override protected void doValidate(final PlainAttrValue attrValue) { Matcher matcher = SyncopeConstants.EMAIL_PATTERN.matcher(attrValue.<CharSequence>getValue()); if (!matcher.matches()) { throw new InvalidPlainAttrValueException("\"" + attrValue.getValue() + "\" is not a valid email address"); } } }
@Override protected void doValidate(final PlainAttrValue attrValue) { Boolean value = attrValue.getValue(); if (!value) { throw new InvalidPlainAttrValueException("This attribute must be set to \"true\""); } } }
@Override protected void doValidate(final PlainAttrValue attrValue) { try { new URL(attrValue.getStringValue()); } catch (MalformedURLException e) { throw new InvalidPlainAttrValueException("\"" + attrValue.getValue() + "\" is not a valid URL"); } } }
query.append("LOWER(?").append(setParameter(parameters, attrValue.getValue())).append(')'); } else { query.append('?').append(setParameter(parameters, attrValue.getValue())); query.append(">="); query.append('?').append(setParameter(parameters, attrValue.getValue())); break; query.append('>'); query.append('?').append(setParameter(parameters, attrValue.getValue())); break; query.append("<="); query.append('?').append(setParameter(parameters, attrValue.getValue())); break; query.append('<'); query.append('?').append(setParameter(parameters, attrValue.getValue())); break;
@Override public List<PlainAttrValue> beforePropagation( final Item item, final Entity entity, final List<PlainAttrValue> values) { if (StringUtils.isNotBlank(propagationJEXL) && values != null) { values.forEach(value -> { Object originalValue = value.getValue(); if (originalValue != null) { JexlContext jexlContext = new MapContext(); if (entity != null) { JexlUtils.addFieldsToContext(entity, jexlContext); if (entity instanceof Any) { JexlUtils.addPlainAttrsToContext(((Any<?>) entity).getPlainAttrs(), jexlContext); JexlUtils.addDerAttrsToContext(((Any<?>) entity), jexlContext); } } jexlContext.set("value", originalValue.toString()); value.setBinaryValue(null); value.setBooleanValue(null); value.setDateValue(null); value.setDoubleValue(null); value.setLongValue(null); value.setStringValue(JexlUtils.evaluate(propagationJEXL, jexlContext)); } }); return values; } return JEXLItemTransformer.super.beforePropagation(item, entity, values); }