freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [29/50] incubator-freemarker git commit: Manual: Added a note about implementing directives and methods in Java, so the less people misses this.
Date Sun, 12 Jun 2016 16:54:10 GMT
Manual: Added a note about implementing directives and methods in Java, so the less people
misses this.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/6eb6ed7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/6eb6ed7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/6eb6ed7a

Branch: refs/heads/2.3
Commit: 6eb6ed7a874154fdf15c4a20bbe62eece7ebd846
Parents: 43caaaf
Author: ddekany <ddekany@apache.org>
Authored: Sat Jun 4 21:51:56 2016 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sat Jun 4 21:51:56 2016 +0200

----------------------------------------------------------------------
 src/manual/en_US/book.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/6eb6ed7a/src/manual/en_US/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index e714128..1965625 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -4782,6 +4782,22 @@ ${("green " + "mouse")?upper_case}  &lt;#-- GREEN MOUSE --&gt;
           <para>Also, you may interested in namespaces: <xref
           linkend="dgui_misc_namespace"/>. Namespaces help you to organize and
           reuse your commonly used macros.</para>
+
+          <para>Java programmers might want to know that directives (macros
+          are directives) and methods (function-like things) can also be
+          written in Java language, by<link
+          linkend="pgui_datamodel_directive"> implementing the
+          <literal>TemplateDirectiveModel</literal></link> or
+          <literal>TemplateMethodModelEx</literal> interfaces, respectively.
+          Then you can pull in the Java implementations into the template like
+          <literal>&lt;#assign foo =
+          "com.example.FooDirective"?new()&gt;</literal> or
+          <literal>&lt;#assign foo =
+          "com.example.FooMethod"?new()&gt;</literal> on the same place where
+          you would have <literal>&lt;#macro foo
+          <replaceable>...</replaceable>&gt;</literal> or
+          <literal>&lt;#function foo
+          <replaceable>...</replaceable>&gt;</literal> otherwise.</para>
         </section>
       </section>
 


Mime
View raw message