EdmString extends SingletonPrimitiveType { @Override public String toUriLiteral(final String literal) { if (literal == null) { return null; } final int length = literal.length(); final StringBuilder uriLiteral = new StringBuilder(length + 2); uriLiteral.append(uriPrefix); for (int i = 0; i < length; i++) { final char c = literal.charAt(i); if (c == '\'') { uriLiteral.append(c); } uriLiteral.append(c); } uriLiteral.append(uriSuffix); return uriLiteral.toString(); }  static EdmString getInstance(); @Override Class<?> getDefaultType(); @Override String toUriLiteral(final String literal); @Override String fromUriLiteral(final String literal);  }
@Test public void toUriLiteral() throws Exception { assertEquals("'StringValue'", instance.toUriLiteral("StringValue")); assertEquals("'String''Value'", instance.toUriLiteral("String'Value")); assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value")); }