From notifications-return-5211-archive-asf-public=cust-asf.ponee.io@freemarker.incubator.apache.org Sat Mar 10 21:24:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 885AC18067C for ; Sat, 10 Mar 2018 21:24:55 +0100 (CET) Received: (qmail 53956 invoked by uid 500); 10 Mar 2018 20:24:54 -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 53947 invoked by uid 99); 10 Mar 2018 20:24:54 -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, 10 Mar 2018 20:24:54 +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 043AA1800D0 for ; Sat, 10 Mar 2018 20:24:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -10.53 X-Spam-Level: X-Spam-Status: No, score=-10.53 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_MANYCOMMENTS=1.2, KAM_SHORT=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JYwT1pI5dEYS for ; Sat, 10 Mar 2018 20:24:32 +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 9B5DC60D12 for ; Sat, 10 Mar 2018 20:24:15 +0000 (UTC) Received: (qmail 51541 invoked by uid 99); 10 Mar 2018 20:24:14 -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, 10 Mar 2018 20:24:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA814F6562; Sat, 10 Mar 2018 20:24:12 +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: Sat, 10 Mar 2018 20:24:52 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [41/51] [partial] incubator-freemarker-site git commit: 2.3.28 preview javadoc http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/28940aad/builds/fm2.3.28/api/freemarker/cache/TemplateConfigurationFactoryException.html ---------------------------------------------------------------------- diff --git a/builds/fm2.3.28/api/freemarker/cache/TemplateConfigurationFactoryException.html b/builds/fm2.3.28/api/freemarker/cache/TemplateConfigurationFactoryException.html new file mode 100644 index 0000000..37b19b8 --- /dev/null +++ b/builds/fm2.3.28/api/freemarker/cache/TemplateConfigurationFactoryException.html @@ -0,0 +1,280 @@ + + + + + + +TemplateConfigurationFactoryException (FreeMarker 2.3.28-nightly_20180310T195428Z-incubating API) + + + + + + + + + + + + +
+
freemarker.cache
+

Class TemplateConfigurationFactoryException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • freemarker.cache.TemplateConfigurationFactoryException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class TemplateConfigurationFactoryException
    +extends java.lang.Exception
    +
    Non-I/O exception thrown by TemplateConfigurationFactory-s.
    +
    +
    Since:
    +
    2.3.24
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TemplateConfigurationFactoryException

        +
        public TemplateConfigurationFactoryException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        TemplateConfigurationFactoryException

        +
        public TemplateConfigurationFactoryException(java.lang.String message,
        +                                             java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/28940aad/builds/fm2.3.28/api/freemarker/cache/TemplateLoader.html ---------------------------------------------------------------------- diff --git a/builds/fm2.3.28/api/freemarker/cache/TemplateLoader.html b/builds/fm2.3.28/api/freemarker/cache/TemplateLoader.html new file mode 100644 index 0000000..d1835e9 --- /dev/null +++ b/builds/fm2.3.28/api/freemarker/cache/TemplateLoader.html @@ -0,0 +1,388 @@ + + + + + + +TemplateLoader (FreeMarker 2.3.28-nightly_20180310T195428Z-incubating API) + + + + + + + + + + + + +
+
freemarker.cache
+

Interface TemplateLoader

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

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidcloseTemplateSource(java.lang.Object templateSource) +
      Closes the template source, releasing any resources held that are only required for reading the template and/or + its metadata.
      +
      java.lang.ObjectfindTemplateSource(java.lang.String name) +
      Finds the template in the backing storage and returns an object that identifies the storage location where the + template can be loaded from.
      +
      longgetLastModified(java.lang.Object templateSource) +
      Returns the time of last modification of the specified template source.
      +
      java.io.ReadergetReader(java.lang.Object templateSource, + java.lang.String encoding) +
      Returns the character stream of a template represented by the specified template source.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        findTemplateSource

        +
        java.lang.Object findTemplateSource(java.lang.String name)
        +                             throws java.io.IOException
        +
        Finds the template in the backing storage and returns an object that identifies the storage location where the + template can be loaded from. See the return value for more information.
        +
        +
        Parameters:
        +
        name - The name (template root directory relative path) of the template, already localized and normalized by + the cache. It is completely up to the loader implementation to + interpret the name, however it should expect to receive hierarchical paths where path components are + separated by a slash (not backslash). Backslashes (or any other OS specific separator character) are + not considered as separators by FreeMarker, and thus they will not be replaced with slash before + passing to this method, so it's up to the template loader to handle them (say, by throwing an + exception that tells the user that the path (s)he has entered is invalid, as (s)he must use slash -- + typical mistake of Windows users). The passed names are always considered relative to some + loader-defined root location (often referred as the "template root directory"), and will never start + with a slash, nor will they contain a path component consisting of either a single or a double dot -- + these are all resolved by the template cache before passing the name to the loader. As a side effect, + paths that trivially reach outside template root directory, such as ../my.ftl, will be + rejected by the template cache, so they never reach the template loader. Note again, that if the path + uses backslash as path separator instead of slash as (the template loader should not accept that), the + normalization will not properly happen, as FreeMarker (the cache) recognizes only the slashes as + separators.
        +
        Returns:
        +
        An object representing the template source, which can be supplied in subsequent calls to + getLastModified(Object) and getReader(Object, String), when those are called on the + same TemplateLoader. null must be returned if the source for the template doesn't exist; + don't throw exception then! The exact type of this object is up to the TemplateLoader + implementation. As this object is possibly used as hash key in caches, and is surly compared with another + template source for equality, it must have a proper Object.equals(Object) and + Object.hashCode()) implementation. Especially, template sources that refer to the same + physical source must be equivalent, otherwise template caching can become inefficient. This is only + expected from Object.equals(Object) when the compared template sources came from the same + TemplateLoader instance. Also, it must not influence the equality if the source is open or + closed (closeTemplateSource(Object)).
        +
        Throws:
        +
        java.io.IOException - When an error occurs that makes it impossible to find out if the template exists, or to access the + existing template. Don't throw exception if the template doesn't exist, instead return with + null then!
        +
        +
      • +
      + + + +
        +
      • +

        getLastModified

        +
        long getLastModified(java.lang.Object templateSource)
        +
        Returns the time of last modification of the specified template source. This method is called after + findTemplateSource().
        +
        +
        Parameters:
        +
        templateSource - an object representing a template source, obtained through a prior call to + findTemplateSource(String). This must be an object on which + closeTemplateSource(Object) wasn't applied yet.
        +
        Returns:
        +
        the time of last modification of the specified template source, or -1 if the time is not known.
        +
        +
      • +
      + + + +
        +
      • +

        getReader

        +
        java.io.Reader getReader(java.lang.Object templateSource,
        +                         java.lang.String encoding)
        +                  throws java.io.IOException
        +
        Returns the character stream of a template represented by the specified template source. This method is possibly + called for multiple times for the same template source object, and it must always return a Reader that + reads the template from its beginning. Before this method is called for the second time (or later), its caller + must close the previously returned Reader, and it must not use it anymore. That is, this method is not + required to support multiple concurrent readers for the same source templateSource object. + +

        + Typically, this method is called if the template is missing from the cache, or if after calling + findTemplateSource(String) and getLastModified(Object) it was determined that the cached copy + of the template is stale. Then, if it turns out that the encoding parameter used doesn't match the actual + template content (based on the #ftl encoding=... header), this method will be called for a second time + with the correct encoding parameter value.

        +
        +
        Parameters:
        +
        templateSource - an object representing a template source, obtained through a prior call to + findTemplateSource(String). This must be an object on which + closeTemplateSource(Object) wasn't applied yet.
        +
        encoding - the character encoding used to translate source bytes to characters. Some loaders may not have access + to the byte representation of the template stream, and instead directly obtain a character stream. + These loaders should ignore the encoding parameter.
        +
        Returns:
        +
        A Reader representing the template character stream. It's the responsibility of the caller (which + is TemplateCache usually) to close() it. The Reader is not required to work after + the templateSource was closed (closeTemplateSource(Object)).
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs while accessing the stream.
        +
        +
      • +
      + + + +
        +
      • +

        closeTemplateSource

        +
        void closeTemplateSource(java.lang.Object templateSource)
        +                  throws java.io.IOException
        +
        Closes the template source, releasing any resources held that are only required for reading the template and/or + its metadata. This is the last method that is called by the TemplateCache for a template source, except + that Object.equals(Object) is might called later too. TemplateCache ensures that this method will + be called on every object that is returned from findTemplateSource(String).
        +
        +
        Parameters:
        +
        templateSource - the template source that should be closed.
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/28940aad/builds/fm2.3.28/api/freemarker/cache/TemplateLookupContext.html ---------------------------------------------------------------------- diff --git a/builds/fm2.3.28/api/freemarker/cache/TemplateLookupContext.html b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupContext.html new file mode 100644 index 0000000..5dc5e35 --- /dev/null +++ b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupContext.html @@ -0,0 +1,367 @@ + + + + + + +TemplateLookupContext (FreeMarker 2.3.28-nightly_20180310T195428Z-incubating API) + + + + + + + + + + + + +
+
freemarker.cache
+

Class TemplateLookupContext

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • freemarker.cache.TemplateLookupContext
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        lookupWithAcquisitionStrategy

        +
        public abstract TemplateLookupResult lookupWithAcquisitionStrategy(java.lang.String templateName)
        +                                                            throws java.io.IOException
        +
        Finds the template source based on its normalized name; handles * steps (so called acquisition), + otherwise it just calls TemplateLoader.findTemplateSource(String).
        +
        +
        Parameters:
        +
        templateName - Must be a normalized name, like "foo/bar/baaz.ftl". A name is not normalized when, among + others, it starts with /, or contains . or .. path steps, or it uses + backslash (\) instead of /. A normalized name might contains "*" path steps + (acquisition).
        +
        Returns:
        +
        The result of the lookup. Not null; check TemplateLookupResult.isPositive() to see if the + lookup has found anything.
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getTemplateName

        +
        public java.lang.String getTemplateName()
        +
        The normalized name (path) of the template (relatively to the TemplateLoader). Not null.
        +
      • +
      + + + +
        +
      • +

        getTemplateLocale

        +
        public java.util.Locale getTemplateLocale()
        +
        null if localized lookup is disabled (see Configuration.getLocalizedLookup()), otherwise the + locale requested.
        +
      • +
      + + + +
        +
      • +

        getCustomLookupCondition

        +
        public java.lang.Object getCustomLookupCondition()
        +
        Returns the value of the customLookupCondition parameter of + Configuration.getTemplate(String, Locale, Object, String, boolean, boolean); see requirements there, such + as having a proper Object.equals(Object) and Object.hashCode() method. The interpretation of this + value is up to the custom TemplateLookupStrategy. Usually, it's used similarly to as the default lookup + strategy uses getTemplateLocale(), that is, to look for a template variation that satisfies the + condition, and then maybe fall back to more generic template if that's missing.
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/28940aad/builds/fm2.3.28/api/freemarker/cache/TemplateLookupResult.html ---------------------------------------------------------------------- diff --git a/builds/fm2.3.28/api/freemarker/cache/TemplateLookupResult.html b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupResult.html new file mode 100644 index 0000000..cb09ed8 --- /dev/null +++ b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupResult.html @@ -0,0 +1,266 @@ + + + + + + +TemplateLookupResult (FreeMarker 2.3.28-nightly_20180310T195428Z-incubating API) + + + + + + + + + + + + +
+
freemarker.cache
+

Class TemplateLookupResult

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • freemarker.cache.TemplateLookupResult
    • +
    +
  • +
+
+ +
+
+
    +
  • + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getTemplateSourceName

        +
        public abstract java.lang.String getTemplateSourceName()
        +
        The source name of the template found (see Template.getSourceName()), or null if + isPositive() is false.
        +
      • +
      + + + +
        +
      • +

        isPositive

        +
        public abstract boolean isPositive()
        +
        Tells if the lookup has found a matching template.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/28940aad/builds/fm2.3.28/api/freemarker/cache/TemplateLookupStrategy.html ---------------------------------------------------------------------- diff --git a/builds/fm2.3.28/api/freemarker/cache/TemplateLookupStrategy.html b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupStrategy.html new file mode 100644 index 0000000..91b53bf --- /dev/null +++ b/builds/fm2.3.28/api/freemarker/cache/TemplateLookupStrategy.html @@ -0,0 +1,381 @@ + + + + + + +TemplateLookupStrategy (FreeMarker 2.3.28-nightly_20180310T195428Z-incubating API) + + + + + + + + + + + + +
+
freemarker.cache
+

Class TemplateLookupStrategy

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • freemarker.cache.TemplateLookupStrategy
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public abstract class TemplateLookupStrategy
    +extends java.lang.Object
    +
    Finds the TemplateLoader-level (storage-level) template source for the template name with which the template + was requested (as in Configuration.getTemplate(String)). This usually means trying various + TemplateLoader-level template names (so called source names; see also Template.getSourceName()) that + were deduced from the requested name. Trying a name usually means calling + TemplateLookupContext.lookupWithAcquisitionStrategy(String) with it and checking the value of + TemplateLookupResult.isPositive(). + +

    + Before you write your own lookup strategy, know that: +

      +
    • A template lookup strategy meant to operate solely with template names, not with TemplateLoader-s + directly. Basically, it's a mapping between the template names that templates and API-s like + Configuration.getTemplate(String) see, and those that the underlying TemplateLoader sees. +
    • A template lookup strategy doesn't influence the template's name (Template.getName()), which is the + normalized form of the template name as it was requested (with Configuration.getTemplate(String), etc.). It + only influences the so called source name of the template (Template.getSourceName()). The template's name is + used as the basis for resolving relative inclusions/imports in the template. The source name is pretty much only used + in error messages as error location, and of course, to actually load the template "file". +
    • Understand the impact of the last point if your template lookup strategy fiddles not only with the file name part + of the template name, but also with the directory part. For example, one may want to map "foo.ftl" to "en/foo.ftl", + "fr/foo.ftl", etc. That's legal, but the result is kind of like if you had several root directories ("en/", "fr/", + etc.) that are layered over each other to form a single merged directory. (This is what's desirable in typical + applications, yet it can be confusing.) +
    +
    +
    Since:
    +
    2.3.22
    +
    See Also:
    +
    Configuration.setTemplateLookupStrategy(TemplateLookupStrategy)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        DEFAULT_2_3_0

        +
        public static final TemplateLookupStrategy DEFAULT_2_3_0
        +

        + The default lookup strategy of FreeMarker. + +

        + Through an example: Assuming localized lookup is enabled and that a template is requested for the name + example.ftl and Locale("es", "ES", "Traditional_WIN"), it will try the following template names, + in this order: "foo_en_AU_Traditional_WIN.ftl", "foo_en_AU_Traditional.ftl", + "foo_en_AU.ftl", "foo_en.ftl", "foo.ftl". It stops at the first variation where it finds + a template. (If the template name contains "*" steps, finding the template for the attempted localized variation + happens with the template acquisition mechanism.) If localized lookup is disabled, it won't try to add any locale + strings, so it just looks for "foo.ftl". + +

        + The generation of the localized name variation with the default lookup strategy, happens like this: It removes + the file extension (the part starting with the last dot), then appends Locale.toString() after + it, and puts back the extension. Then it starts to remove the parts from the end of the locale, considering + "_" as the separator between the parts. It won't remove parts that are not part of the locale string + (like if the requested template name is foo_bar.ftl, it won't remove the "_bar").

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

      Constructor Detail

      + + + +
        +
      • +

        TemplateLookupStrategy

        +
        public TemplateLookupStrategy()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + +