I am using Rythm to modify multiple strings in my main String Object. Issue is my main String Object contains mail Id also. As I don't want to replace @gmail.com, I have not declared it in the Template. But Rythm is trying to modify that also. So if I declare my string as "[email protected]" I am getting the below exception.
Exception in thread "main" org.rythmengine.exception.CompileException: gmail.com cannot be resolved to a type
Template: 0 PIN_FLD_EMAIL_ID STR [0] "[email protected]"
Relevant template source lines:
1: 0 PIN_FLD_EMAIL_ID STR [0] "[email protected]"
Relevant Java source lines:
@Override public org.rythmengine.utils.TextBuilder build(){
buffer().ensureCapacity(49);
p("0 PIN_FLD_EMAIL_ID STR [0] \"abc"); //line: 1
try{pe(gmail.com);} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 1
p("\""); //line: 1
return this;
}
}
If I put it like abcgmail.com then it is able to accept it, but I need @ also. Is there is anyway that my String contains "@" and Rythm may keep it as it is ??
Regards Yogesh Joshi
use two
@@
to escape, so your string should containabc@@gmail.com
instead of[email protected]
. See more on http://rythmengine.org/doc/template_guide.md#at