/**
* @param tag
*/
protected void endRegularTag(Tag tag) {
if (tag.hasBody) {
InnerClassMeta bodyInner = this.getTemplateClassMetaData().addCallTagBodyInnerClass(tag.tagName, tag.tagIndex,
tag.callbackArgs,
tag.getBodyText());
if (bodyInner == null)
throw new RuntimeException("compiler bug? " + tag.tagName + " not allowed to have instance of this tag");
String tagVar = tag.getTagVarName();
String tagClassName = tag.tagName;
if (tagClassName.equals("this")) {
// call itself
tagClassName = this.getTemplateClassMetaData().getClassName();
}
// String tagline = "final " + tagClassName + " " + tagVar + " = new " + tagClassName + "(getOut()); "
// + tagVar;
String tagline = "new " + tagClassName + "(" + getTemplateClassMetaData().getClassName() + ".this)";
// make sure the tag always use the current output buffer;
// if (useWithPlay && !tag.tagName.equals(Each.class.getSimpleName())) {
// tagline += ".setActionRunners(getActionRunners())";
// }
// tagline += ".setOut(getOut()); " + tagVar;
if (tag.argsNamed()) {
tagline += ".render( " + makeLineMarker(tag.startLine) + "\n"
+ bodyInner.getAnonymous(makeLineMarker(tag.startLine)) + ", "
+ (WebUtils.asBoolean(tag.args) ? tag.args : "") + ");";
} else {
tagline += ".render(" + makeLineMarker(tag.startLine) + "\n"
+ (WebUtils.asBoolean(tag.args) ? tag.args + ", " : "")
+ bodyInner.getAnonymous(makeLineMarker(tag.startLine)) + ");";
}
// tagline += makeLineMarker(tag.startLine);
print(tagline);
} else {