private void writeStringExpr(InjectorContext context, Expr expr) throws IOException { if (expr instanceof ConstantExpr) { String str = (String) ((ConstantExpr) expr).getValue(); context.getWriter().append('"'); context.writeEscaped(str); context.getWriter().append('"'); return; } context.getWriter().append("$rt_ustr("); context.writeExpr(expr); context.getWriter().append(")"); }
private void renderProperty(Expr property, InjectorContext context) throws IOException { SourceWriter writer = context.getWriter(); String name = extractPropertyName(property); if (name == null) { writer.append('['); context.writeExpr(property, Precedence.min()); writer.append(']'); } else if (!isIdentifier(name)) { writer.append("[\""); context.writeEscaped(name); writer.append("\"]"); } else { writer.append(".").append(name); } }
private void writeStringExpr(InjectorContext context, Expr expr) throws IOException { if (expr instanceof ConstantExpr) { String str = (String) ((ConstantExpr) expr).getValue(); context.getWriter().append('"'); context.writeEscaped(str); context.getWriter().append('"'); return; } context.getWriter().append("$rt_ustr("); context.writeExpr(expr); context.getWriter().append(")"); }
private void renderProperty(Expr property, InjectorContext context) throws IOException { SourceWriter writer = context.getWriter(); String name = extractPropertyName(property); if (name == null) { writer.append('['); context.writeExpr(property, Precedence.min()); writer.append(']'); } else if (!isIdentifier(name)) { writer.append("[\""); context.writeEscaped(name); writer.append("\"]"); } else { writer.append(".").append(name); } }