{"id":5452,"date":"2014-03-30T22:12:29","date_gmt":"2014-03-30T22:12:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/xtext-first-and-last-character-truncated-in-custom-string-terminals-collection-of-common-programming-errors\/"},"modified":"2014-03-30T22:12:29","modified_gmt":"2014-03-30T22:12:29","slug":"xtext-first-and-last-character-truncated-in-custom-string-terminals-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/xtext-first-and-last-character-truncated-in-custom-string-terminals-collection-of-common-programming-errors\/","title":{"rendered":"XText: first and last character truncated in custom STRING terminals-Collection of common programming errors"},"content":{"rendered":"<p>If you customize the STRING rule, you&#8217;ll have to adapt the respective value converter, too.<\/p>\n<p>Something like this has to be bound in your runtime module:<\/p>\n<pre><code>public class MyStringValueConverter extends STRINGValueConverter {\n\n    @Override\n    protected String toEscapedString(String value) {\n        return value;\n    }\n\n    public String toValue(String string, INode node) {\n        if (string == null)\n            return null;\n        return string;\n    }\n}\n<\/code><\/pre>\n<p>See the docs for details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you customize the STRING rule, you&#8217;ll have to adapt the respective value converter, too. Something like this has to be bound in your runtime module: public class MyStringValueConverter extends STRINGValueConverter { @Override protected String toEscapedString(String value) { return value; } public String toValue(String string, INode node) { if (string == null) return null; return [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5452","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5452"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5452\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}