Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0A6792009F3 for ; Sat, 4 Jun 2016 21:52:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F2D43160A26; Sat, 4 Jun 2016 19:52:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 496F1160A16 for ; Sat, 4 Jun 2016 21:52:09 +0200 (CEST) Received: (qmail 62994 invoked by uid 500); 4 Jun 2016 19:52:08 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 62985 invoked by uid 99); 4 Jun 2016 19:52:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2016 19:52:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C8F6C180536 for ; Sat, 4 Jun 2016 19:52:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id QYTp0oK-F9bN for ; Sat, 4 Jun 2016 19:52:07 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id 79F6B5F256 for ; Sat, 4 Jun 2016 19:52:06 +0000 (UTC) Received: (qmail 62982 invoked by uid 99); 4 Jun 2016 19:52:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2016 19:52:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9095EE009E; Sat, 4 Jun 2016 19:52:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ddekany@apache.org To: notifications@freemarker.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-freemarker git commit: Manual: Added a note about implementing directives and methods in Java, so the less people misses this. Date: Sat, 4 Jun 2016 19:52:05 +0000 (UTC) archived-at: Sat, 04 Jun 2016 19:52:10 -0000 Repository: incubator-freemarker Updated Branches: refs/heads/2.3-gae 43caaaf9d -> 6eb6ed7a8 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-gae Commit: 6eb6ed7a874154fdf15c4a20bbe62eece7ebd846 Parents: 43caaaf Author: ddekany Authored: Sat Jun 4 21:51:56 2016 +0200 Committer: ddekany 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} <#-- GREEN MOUSE --> Also, you may interested in namespaces: . Namespaces help you to organize and reuse your commonly used macros. + + Java programmers might want to know that directives (macros + are directives) and methods (function-like things) can also be + written in Java language, by implementing the + TemplateDirectiveModel or + TemplateMethodModelEx interfaces, respectively. + Then you can pull in the Java implementations into the template like + <#assign foo = + "com.example.FooDirective"?new()> or + <#assign foo = + "com.example.FooMethod"?new()> on the same place where + you would have <#macro foo + ...> or + <#function foo + ...> otherwise.