| java.lang.Object freemarker.core.TemplateObject freemarker.core.TemplateElement freemarker.core.BodyInstruction
BodyInstruction | BodyInstruction(List bodyParameters)(Code) | | |
accept | void accept(Environment env) throws IOException, TemplateException(Code) | | There is actually a subtle but essential point in the code below.
A macro operates in the context in which it is defined. However,
a nested block within a macro instruction is defined in the
context in which the macro was invoked. So, we actually need to
temporarily switch the namespace and macro context back to
what it was before macro invocation to implement this properly.
I (JR) realized this thanks to some incisive comments from Daniel Dekany.
|
Fields inherited from freemarker.core.TemplateObject | int beginColumnbeginLineendColumnendLine(Code)(Java Doc)
|
Methods inherited from freemarker.core.TemplateObject | static void assertNonNull(TemplateModel model, Expression exp, Environment env) throws InvalidReferenceException(Code)(Java Doc) public boolean contains(int column, int line)(Code)(Java Doc) TemplateObject copyLocationFrom(TemplateObject from)(Code)(Java Doc) final public int getBeginColumn()(Code)(Java Doc) final public int getBeginLine()(Code)(Java Doc) abstract public String getCanonicalForm()(Code)(Java Doc) final public int getEndColumn()(Code)(Java Doc) final public int getEndLine()(Code)(Java Doc) public String getEndLocation()(Code)(Java Doc) final public String getSource()(Code)(Java Doc) public String getStartLocation()(Code)(Java Doc) public Template getTemplate()(Code)(Java Doc) static TemplateException invalidTypeException(TemplateModel model, Expression exp, Environment env, String expected) throws TemplateException(Code)(Java Doc) final void setLocation(Template template, Token begin, Token end) throws ParseException(Code)(Java Doc) final void setLocation(Template template, Token begin, TemplateObject end) throws ParseException(Code)(Java Doc) final void setLocation(Template template, TemplateObject begin, Token end) throws ParseException(Code)(Java Doc) final void setLocation(Template template, TemplateObject begin, TemplateObject end) throws ParseException(Code)(Java Doc) void setLocation(Template template, int beginColumn, int beginLine, int endColumn, int endLine) throws ParseException(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|