@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. */ public Object init(InternalContextAdapter context, Object data) throws Exception { super.init(context, data); identifier = getFirstToken().image; uberInfo = new Info(context.getCurrentTemplateName(), getLine(), getColumn()); return data; }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. * @param context * @param data * @return The data object. * @throws TemplateInitException */ public Object init(InternalContextAdapter context, Object data) throws TemplateInitException { super.init(context, data); identifier = getFirstToken().image.intern(); uberInfo = new Info(getTemplateName(), getLine(), getColumn()); strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. * @param context * @param data * @return The data object. * @throws TemplateInitException */ public Object init(InternalContextAdapter context, Object data) throws TemplateInitException { super.init(context, data); identifier = getFirstToken().image; uberInfo = new Info(getTemplateName(), getLine(), getColumn()); strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
/** * simple init - init the tree and get the elementKey from * the AST */ public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws Exception { super.init(rs, context, node); counterName = rsvc.getString(RuntimeConstants.COUNTER_NAME); counterInitialValue = rsvc.getInt(RuntimeConstants.COUNTER_INITIAL_VALUE); /* * this is really the only thing we can do here as everything * else is context sensitive */ elementKey = node.jjtGetChild(0).getFirstToken().image.substring(1); /* * make an uberinfo - saves new's later on */ uberInfo = new Info(context.getCurrentTemplateName(), getLine(),getColumn()); }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. * @param context * @param data * @return The data object. * @throws TemplateInitException */ public Object init(InternalContextAdapter context, Object data) throws TemplateInitException { super.init(context, data); identifier = rsvc.useStringInterning() ? getFirstToken().image.intern() : getFirstToken().image; uberInfo = new Info(getTemplateName(), getLine(), getColumn()); strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); saveTokenImages(); cleanupParserAndTokens(); return data; }
/** * simple init - init our subtree and get what we can from * the AST * @param context * @param data * @return The init result * @throws TemplateInitException */ public Object init( InternalContextAdapter context, Object data) throws TemplateInitException { super.init( context, data ); /* * make an uberinfo - saves new's later on */ uberInfo = new Info(getTemplateName(), getLine(),getColumn()); /* * this is about all we can do */ methodName = getFirstToken().image; paramCount = jjtGetNumChildren() - 1; strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
/** * simple init - init our subtree and get what we can from * the AST * @param context * @param data * @return The init result * @throws TemplateInitException */ public Object init( InternalContextAdapter context, Object data) throws TemplateInitException { super.init( context, data ); /* * make an uberinfo - saves new's later on */ uberInfo = new Info(getTemplateName(), getLine(),getColumn()); /* * this is about all we can do */ methodName = getFirstToken().image; paramCount = jjtGetNumChildren() - 1; strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
uberInfo = new Info(getTemplateName(), getLine(), getColumn());
uberInfo = new Info(getTemplateName(), getLine(), getColumn());
uberInfo = new Info(getTemplateName(), getLine(), getColumn());
/** * simple init - init our subtree and get what we can from * the AST * @param context * @param data * @return The init result * @throws TemplateInitException */ public Object init( InternalContextAdapter context, Object data) throws TemplateInitException { super.init( context, data ); /* * make an uberinfo - saves new's later on */ uberInfo = new Info(getTemplateName(), getLine(),getColumn()); /* * this is about all we can do */ methodName = getFirstToken().image; paramCount = jjtGetNumChildren() - 1; strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); cleanupParserAndTokens(); return data; }
public Object init(InternalContextAdapter context, Object data) throws Exception { /* * init our children */ super.init(context, data); /* * the only thing we can do in init() is getRoot() * as that is template based, not context based, * so it's thread- and context-safe */ rootString = getRoot(); numChildren = jjtGetNumChildren(); /* * and if appropriate... */ if (numChildren > 0 ) { identifier = jjtGetChild(numChildren - 1).getFirstToken().image; } /* * make an uberinfo - saves new's later on */ uberInfo = new Info(context.getCurrentTemplateName(), getLine(),getColumn()); return data; }
uberInfo = new Info(this.getTemplateName(), getLine(),getColumn());
uberInfo = new Info(this.getTemplateName(), getLine(),getColumn());
uberInfo = new Info(getTemplateName(), getLine(),getColumn());
uberInfo = new Info(getTemplateName(), getLine(),getColumn());
uberInfo = new Info(getTemplateName(), getLine(),getColumn());