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 ED218200C2A for ; Wed, 1 Mar 2017 19:49:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EBD4F160B70; Wed, 1 Mar 2017 18:49:05 +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 46AAA160B56 for ; Wed, 1 Mar 2017 19:49:04 +0100 (CET) Received: (qmail 20998 invoked by uid 500); 1 Mar 2017 18:49:03 -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 20989 invoked by uid 99); 1 Mar 2017 18:49:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2017 18:49:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 02BD7C9D56 for ; Wed, 1 Mar 2017 18:49:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.567 X-Spam-Level: X-Spam-Status: No, score=-6.567 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id gsmJGWOuwoeh for ; Wed, 1 Mar 2017 18:48:54 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id C77255FE3F for ; Wed, 1 Mar 2017 18:48:52 +0000 (UTC) Received: (qmail 18540 invoked by uid 99); 1 Mar 2017 18:48:37 -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; Wed, 01 Mar 2017 18:48:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 726BFE00B7; Wed, 1 Mar 2017 18:48:37 +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 Date: Wed, 01 Mar 2017 18:49:17 -0000 Message-Id: <96a0378c628f4cf5a5b1f1da8823c829@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [42/51] [partial] incubator-freemarker-site git commit: FM3 API javadocs archived-at: Wed, 01 Mar 2017 18:49:06 -0000 http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/55a5c314/builds/fm3/api/org/apache/freemarker/core/DirectiveCallPlace.html ---------------------------------------------------------------------- diff --git a/builds/fm3/api/org/apache/freemarker/core/DirectiveCallPlace.html b/builds/fm3/api/org/apache/freemarker/core/DirectiveCallPlace.html new file mode 100644 index 0000000..a0fa5d0 --- /dev/null +++ b/builds/fm3/api/org/apache/freemarker/core/DirectiveCallPlace.html @@ -0,0 +1,389 @@ + + + + + + +DirectiveCallPlace (FreeMarker 3.0.0-nightly-incubating API) + + + + + + + + + + + + +
+
org.apache.freemarker.core
+

Interface DirectiveCallPlace

+
+
+
+
    +
  • +
    +
    +
    public interface DirectiveCallPlace
    +
    Gives information about the place where a directive is called from, also lets you attach a custom data object to that + place. Each directive call in a template has its own DirectiveCallPlace object (even when they call the same + directive with the same parameters). The life cycle of the DirectiveCallPlace object is bound to the + Template object that contains the directive call. Hence, the DirectiveCallPlace object and the custom + data you put into it is cached together with the Template (and templates are normally cached - see + Configuration.getTemplate(String)). The custom data is normally initialized on demand, that is, when the + directive call is first executed, via getOrCreateCustomData(Object, ObjectFactory). + +

    + Currently this method doesn't give you access to the Template object, because it's probable that future + versions of FreeMarker will be able to use the same parsed representation of a "file" for multiple Template + objects. Then the call place will be bound to the parsed representation, not to the Template objects that are + based on it. + +

    + Don't implement this interface yourself, as new methods can be added to it any time! It's only meant to be + implemented by the FreeMarker core. + +

    + This interface is currently only used for custom directive calls (that is, a <@...> that calls a + TemplateDirectiveModel, TemplateTransformModel, or a macro).

    +
    +
    Since:
    +
    2.3.22
    +
    See Also:
    +
    Environment.getCurrentDirectiveCallPlace()
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      intgetBeginColumn() +
      The 1-based column number of the first character of the directive call in the template source code, or -1 if it's + not known.
      +
      intgetBeginLine() +
      The 1-based line number of the first character of the directive call in the template source code, or -1 if it's + not known.
      +
      intgetEndColumn() +
      The 1-based column number of the last character of the directive call in the template source code, or -1 if it's + not known.
      +
      intgetEndLine() +
      The 1-based line number of the last character of the directive call in the template source code, or -1 if it's + not known.
      +
      ObjectgetOrCreateCustomData(Object providerIdentity, + ObjectFactory objectFactory) +
      Returns the custom data, or if that's null, then it creates and stores it in an atomic operation then + returns it.
      +
      booleanisNestedOutputCacheable() +
      Tells if the nested content (the body) can be safely cached, as it only depends on the template content (not on + variable values and such) and has no side-effects (other than writing to the output).
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBeginColumn

        +
        int getBeginColumn()
        +
        The 1-based column number of the first character of the directive call in the template source code, or -1 if it's + not known.
        +
      • +
      + + + +
        +
      • +

        getBeginLine

        +
        int getBeginLine()
        +
        The 1-based line number of the first character of the directive call in the template source code, or -1 if it's + not known.
        +
      • +
      + + + +
        +
      • +

        getEndColumn

        +
        int getEndColumn()
        +
        The 1-based column number of the last character of the directive call in the template source code, or -1 if it's + not known. If the directive has an end-tag (</@...>), then it points to the last character of that.
        +
      • +
      + + + +
        +
      • +

        getEndLine

        +
        int getEndLine()
        +
        The 1-based line number of the last character of the directive call in the template source code, or -1 if it's + not known. If the directive has an end-tag (</@...>), then it points to the last character of that.
        +
      • +
      + + + +
        +
      • +

        getOrCreateCustomData

        +
        Object getOrCreateCustomData(Object providerIdentity,
        +                             ObjectFactory objectFactory)
        +                      throws CallPlaceCustomDataInitializationException
        +
        Returns the custom data, or if that's null, then it creates and stores it in an atomic operation then + returns it. This method is thread-safe, however, it doesn't ensure thread safe (like synchronized) access to the + custom data itself. See the top-level documentation of DirectiveCallPlace to understand the scope and + life-cycle of the custom data. Be sure that the custom data only depends on things that get their final value + during template parsing, not on runtime settings. + +

        + This method will block other calls while the objectFactory is executing, thus, the object will be + usually created only once, even if multiple threads request the value when it's still null. It + doesn't stand though when providerIdentity mismatches occur (see later). Furthermore, then it's also + possible that multiple objects created by the same ObjectFactory will be in use on the same time, because + of directive executions already running in parallel, and because of memory synchronization delays (hardware + dependent) between the threads.

        +
        +
        Parameters:
        +
        providerIdentity - This is usually the class of the TemplateDirectiveModel that creates (and uses) the custom + data, or if you are using your own class for the custom data object (as opposed to a class from some + more generic API), then that class. This is needed as the same call place might calls different + directives depending on runtime conditions, and so it must be ensured that these directives won't + accidentally read each other's custom data, ending up with class cast exceptions or worse. In the + current implementation, if there's a providerIdentity mismatch (means, the + providerIdentity object used when the custom data was last set isn't the exactly same object + as the one provided with the parameter now), the previous custom data will be just ignored as if it + was null. So if multiple directives that use the custom data feature use the same call place, + the caching of the custom data can be inefficient, as they will keep overwriting each other's custom + data. (In a more generic implementation the providerIdentity would be a key in a + IdentityHashMap, but then this feature would be slower, while providerIdentity + mismatches aren't occurring in most applications.)
        +
        objectFactory - Called when the custom data wasn't yet set, to create its initial value. If this parameter is + null and the custom data wasn't set yet, then null will be returned. The returned + value of ObjectFactory.createObject() can be any kind of object, but can't be null.
        +
        Returns:
        +
        The current custom data object, or possibly null if there was no ObjectFactory provided.
        +
        Throws:
        +
        CallPlaceCustomDataInitializationException - If the ObjectFactory had to be invoked but failed.
        +
        +
      • +
      + + + +
        +
      • +

        isNestedOutputCacheable

        +
        boolean isNestedOutputCacheable()
        +
        Tells if the nested content (the body) can be safely cached, as it only depends on the template content (not on + variable values and such) and has no side-effects (other than writing to the output). Examples of cases that give + false: <@foo>Name: ${name}, + <@foo>Name: <#if showIt>Joe</#if></@foo>. Examples of cases that give true: + <@foo>Name: Joe</@foo>, <@foo />. Note that we get true for no nested content, because + that's equivalent with 0-length nested content in FTL. + +

        + This method returns a pessimistic result. For example, if it sees a custom directive call, it can't know what it + does, so it will assume that it's not cacheable.

        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/55a5c314/builds/fm3/api/org/apache/freemarker/core/Environment.Namespace.html ---------------------------------------------------------------------- diff --git a/builds/fm3/api/org/apache/freemarker/core/Environment.Namespace.html b/builds/fm3/api/org/apache/freemarker/core/Environment.Namespace.html new file mode 100644 index 0000000..cbb36ab --- /dev/null +++ b/builds/fm3/api/org/apache/freemarker/core/Environment.Namespace.html @@ -0,0 +1,308 @@ + + + + + + +Environment.Namespace (FreeMarker 3.0.0-nightly-incubating API) + + + + + + + + + + + + +
+
org.apache.freemarker.core
+

Class Environment.Namespace

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getTemplate

        +
        public Template getTemplate()
        +
        +
        Returns:
        +
        the Template object with which this Namespace is associated.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + +