in scim-spec/scim-spec-schema/src/main/java/org/apache/directory/scim/spec/filter/AttributeComparisonExpression.java [84:108]
private String createCompareValueString() {
String compareValueString;
if (this.compareValue == null) {
compareValueString = "null";
} else if (this.compareValue instanceof String) {
// TODO change this to escapeJson() when dependencies get upgraded
String escaped = StringEscapeUtils.escapeEcmaScript((String) this.compareValue)
// StringEscapeUtils follows the outdated JSON spec requiring "/" to be escaped, this could subtly break things
.replaceAll("\\\\/", "/")
// We don't want single-quotes escaped, this will be unnecessary with escapeJson()
.replaceAll("\\\\'", "'");
compareValueString = QUOTE + escaped + QUOTE;
} else if (this.compareValue instanceof Date) {
compareValueString = QUOTE + toDateTimeString((Date) this.compareValue) + QUOTE;
} else if (this.compareValue instanceof LocalDate) {
compareValueString = QUOTE + toDateString((LocalDate) this.compareValue) + QUOTE;
} else if (this.compareValue instanceof LocalDateTime) {
compareValueString = QUOTE + toDateTimeString((LocalDateTime) this.compareValue) + QUOTE;
} else {
compareValueString = this.compareValue.toString();
}
return compareValueString;
}