http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/cddd52a8/documentation/extensions/mod_functions.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_functions.html b/documentation/extensions/mod_functions.html index 7d64aed..71a6bea 100644 --- a/documentation/extensions/mod_functions.html +++ b/documentation/extensions/mod_functions.html @@ -125,180 +125,103 @@ <h1>Apache Tamaya - Extension: Functions</h1> </div> - <p><em>2018-04-26</em></p> + <p><em>2018-05-17</em></p> - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Functions">Tamaya Functions (Extension Module)</h2> -<div class="sectionbody"> -<div class="paragraph"> -<p>Tamaya <em>Functions</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> -</div> -<div class="sect2"> -<h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> -<div class="paragraph"> -<p>Tamaya <em>Functions</em> provides several functional extensions using the ConfigOperator,ConfigQuery extension points. Most -functional extension are accessible from the ConfigurationFunction singleton. When importing its methods statically -one can use the methods to achieve some interesting effects, e.g.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">import static org.apache.tamaya.functions.ConfigurationFunctions.*; + <p><div id="preamble"> + <div class="sectionbody"> + <!-- toc disabled --> + </div> +</div> +<div class="sect1"> + <h2 id="Functions">Tamaya Functions (Extension Module)</h2> + <div class="sectionbody"> + <div class="paragraph"> + <p>Tamaya <em>Functions</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> + </div> + <div class="sect2"> + <h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> + <div class="paragraph"> + <p>Tamaya <em>Functions</em> provides several functional extensions using the ConfigOperator,ConfigQuery extension points. Most functional extension are accessible from the ConfigurationFunction singleton. When importing its methods statically one can use the methods to achieve some interesting effects, e.g.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">import static org.apache.tamaya.functions.ConfigurationFunctions.*; -Set<String> sections = ConfigurationProvider.getConfiguration().with(areas("a", false).with(transitiveAreas());</code></pre> -</div> -</div> -<div class="paragraph"> -<p>The expression above returns all fully qualified section names that are child sections of the root section 'a'. -So given the entries a.b.entry1, a.b.entry2, a.a.entry3, a.b.c.entry4 the reult would be a, a.a, a.b, a.b.c.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_compatibility">Compatibility</h3> -<div class="paragraph"> -<p>The module is based on Java 7, so it can be used with Java 7 and beyond.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>For using the functionality shown in this document you only must add the corresponding dependency to your module:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> +Set<String> sections = ConfigurationProvider.getConfiguration().with(areas("a", false).with(transitiveAreas());</code></pre> + </div> + </div> + <div class="paragraph"> + <p>The expression above returns all fully qualified section names that are child sections of the root section 'a'. So given the entries a.b.entry1, a.b.entry2, a.a.entry3, a.b.c.entry4 the reult would be a, a.a, a.b, a.b.c.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_compatibility">Compatibility</h3> + <div class="paragraph"> + <p>The module is based on Java 7, so it can be used with Java 7 and beyond.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_installation">Installation</h3> + <div class="paragraph"> + <p>For using the functionality shown in this document you only must add the corresponding dependency to your module:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> <groupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-functions</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_the_provided_functions">The Provided Functions</h3> -<div class="sect3"> -<h4 id="_functions_on_configurationfunctions">Functions on ConfigurationFunctions</h4> -<div class="paragraph"> -<p>The following sections explain the provided functions defined by ConfigurationFunctions singleton.</p> -</div> -<div class="ulist"> -<ul> -<li> -<p><strong>ConfigOperator filter(PropertyMatcher matcher)</strong> creates a ConfigOperator that creates a Configuration -containing only keys that are selected by the given <em>matcher predicate</em>. The PropertyMatcher hereby allows to evaluate not only -the <em>key</em>, but also the <em>value</em>.</p> -</li> -<li> -<p><strong>ConfigOperator map(KeyMapper keyMapper)</strong> creates a ConfigOperator that maps the keys as defined -by the given <em>keyMapper</em>.</p> -</li> -<li> -<p><strong>ConfigOperator section(String section)</strong> creates a ConfigOperator that creates a Configuration containing only -entries that are direct or indirect members of the given section.</p> -</li> -<li> -<p><strong>ConfigOperator section(String areaKey, boolean stripKeys)</strong> creates a ConfigOperator that creates a Configuration -containing only entries that are direct or indirect members of the given section. Hereby <em>stripKeys</em> allows to determine -if the returned entries should be relative to the search criteria {{stripKeys=true}} or absolute keys.</p> -</li> -<li> -<p><strong>isKeyInSection(String section, String sectionKey)</strong> allows to easily determine if a given <em>key</em> is a direct or indirect member -of a given section.</p> -</li> -<li> -<p><strong>boolean isKeyInSections(String key, String…​ sectionKeys)</strong> allows to easily determine if one key of given -<em>key</em> is a direct or indirect member of at least one of the given <em>sectionKeys</em>.</p> -</li> -<li> -<p><strong>ConfigQuery<Set<String>> sections()</strong> allows to query all the contained fully qualified section names (the ones that -also have parameters present).</p> -</li> -<li> -<p><strong>ConfigQuery<Set<String>> transitiveSections()</strong> allows to query all the contained fully qualified section names, -including the transitive closure of sections.</p> -</li> -<li> -<p><strong>ConfigQuery<Set<String>> sections(final Predicate<String> predicate)</strong> allows to query all the contained fully -qualified section names that are selected by the given <em>predicate</em>.</p> -</li> -<li> -<p><strong>ConfigQuery<Set<String>> sections(final Predicate<String> predicate)</strong> allows to query all the contained fully -qualified section names that are selected by the given <em>predicate</em>, including the transitive closure of sections -identified.</p> -</li> -<li> -<p><strong>ConfigOperator sectionsRecursive(String…​ sectionKeys)</strong> provides a ConfigOperator that filters all sections identified -by the given <em>sectionKeys</em> and its child sections.</p> -</li> -<li> -<p><strong>ConfigOperator sectionRecursive(final boolean stripKeys, final String…​ sectionKeys)</strong> provides a ConfigOperator -that filters all sections identified by the given <em>sectionKeys</em> and its child sections. <em>stripKeys</em> allows to -determine if the resulting configuration should be relative to the selected areas ({{stripKeys=true}}) or -absolute (filtering only).</p> -</li> -<li> -<p><strong>ConfigQuery<String> jsonInfo()</strong> returns a query that converts a Configuration into a JSON formatted String -representation.</p> -</li> -</ul> -</div> -</div> -<div class="sect3"> -<h4 id="_functions_on_propertysourcefunctions">Functions on PropertySourceFunctions</h4> -<div class="paragraph"> -<p>The following sections explain the provided functions defined by PropertySourceFunctions singleton.</p> -</div> -<div class="ulist"> -<ul> -<li> -<p><strong>PropertySource addMetaData(PropertySource propertySource, Map<String,String> metaData)</strong> Creates a new PropertySource -with the given metadata added.</p> -</li> -<li> -<p><strong>boolean isKeyInSection(String key, String sectionKey)</strong> Checks if the given <em>key</em> is a direct or indirect member of -one of the given <em>sectionKey</em>.</p> -</li> -<li> -<p><strong>boolean isKeyInSections(String key, String…​ sectionKeys)</strong> Checks if the given <em>key</em> is a direct or indirect member of -one of one of the given <em>sectionKeys</em>.</p> -</li> -<li> -<p><strong>Set<String> sections(Map<String, String> properties)</strong> Extracts the sections from the given properties.</p> -</li> -<li> -<p><strong>Set<String> transitiveSections(Map<String, String> properties)</strong> Extracts the transitive sections from the given -properties.</p> -</li> -<li> -<p><strong>Set<String> sections(Map<String, String> properties, final Predicate<String> predicate)</strong> Extracts the sections -from the given properties, also filtering with the given predicate.</p> -</li> -<li> -<p><strong>Set<String> transitiveSections(Map<String, String> properties, Predicate<String> predicate)</strong> Extracts the transitive -sections from the given properties, also filtering with the given predicate.</p> -</li> -<li> -<p><strong>Map<String,String> sectionsRecursive(Map<String, String> properties, String…​ sectionKeys)</strong> Creates w PropertySource -only containing the sections that a direct or indirect children of the given <em>sectionKeys</em>.</p> -</li> -<li> -<p><strong>Map<String,String> sectionRecursive(Map<String, String> properties, boolean stripKeys, String…​ sectionKeys)</strong> Creates w PropertySource -only containing the sections that a direct or indirect children of the given <em>sectionKeys</em>. With <em>stripKeys</em> one can -select of the returned values should be relative to its selection of be fully qualified.</p> -</li> -<li> -<p><strong>String stripSectionKeys(String key, String…​ sectionKeys)</strong> This function strips away the matching section key as given -in <em>sectionKeys</em> from a given <em>key</em>.</p> -</li> -</ul> -</div> -</div> -</div> -</div> +</dependency></code></pre> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_the_provided_functions">The Provided Functions</h3> + <div class="sect3"> + <h4 id="_functions_on_configurationfunctions">Functions on ConfigurationFunctions</h4> + <div class="paragraph"> + <p>The following sections explain the provided functions defined by ConfigurationFunctions singleton.</p> + </div> + <div class="ulist"> + <ul> + <li> <p><strong>ConfigOperator filter(PropertyMatcher matcher)</strong> creates a ConfigOperator that creates a Configuration containing only keys that are selected by the given <em>matcher predicate</em>. The PropertyMatcher hereby allows to evaluate not only the <em>key</em>, but also the <em>value</em>.</p> </li> + <li> <p><strong>ConfigOperator map(KeyMapper keyMapper)</strong> creates a ConfigOperator that maps the keys as defined by the given <em>keyMapper</em>.</p> </li> + <li> <p><strong>ConfigOperator section(String section)</strong> creates a ConfigOperator that creates a Configuration containing only entries that are direct or indirect members of the given section.</p> </li> + <li> <p><strong>ConfigOperator section(String areaKey, boolean stripKeys)</strong> creates a ConfigOperator that creates a Configuration containing only entries that are direct or indirect members of the given section. Hereby <em>stripKeys</em> allows to determine if the returned entries should be relative to the search criteria {{stripKeys=true}} or absolute keys.</p> </li> + <li> <p><strong>isKeyInSection(String section, String sectionKey)</strong> allows to easily determine if a given <em>key</em> is a direct or indirect member of a given section.</p> </li> + <li> <p><strong>boolean isKeyInSections(String key, Stringâ¦â sectionKeys)</strong> allows to easily determine if one key of given <em>key</em> is a direct or indirect member of at least one of the given <em>sectionKeys</em>.</p> </li> + <li> <p><strong>ConfigQuery<Set<String>> sections()</strong> allows to query all the contained fully qualified section names (the ones that also have parameters present).</p> </li> + <li> <p><strong>ConfigQuery<Set<String>> transitiveSections()</strong> allows to query all the contained fully qualified section names, including the transitive closure of sections.</p> </li> + <li> <p><strong>ConfigQuery<Set<String>> sections(final Predicate<String> predicate)</strong> allows to query all the contained fully qualified section names that are selected by the given <em>predicate</em>.</p> </li> + <li> <p><strong>ConfigQuery<Set<String>> sections(final Predicate<String> predicate)</strong> allows to query all the contained fully qualified section names that are selected by the given <em>predicate</em>, including the transitive closure of sections identified.</p> </li> + <li> <p><strong>ConfigOperator sectionsRecursive(Stringâ¦â sectionKeys)</strong> provides a ConfigOperator that filters all sections identified by the given <em>sectionKeys</em> and its child sections.</p> </li> + <li> <p><strong>ConfigOperator sectionRecursive(final boolean stripKeys, final Stringâ¦â sectionKeys)</strong> provides a ConfigOperator that filters all sections identified by the given <em>sectionKeys</em> and its child sections. <em>stripKeys</em> allows to determine if the resulting configuration should be relative to the selected areas ({{stripKeys=true}}) or absolute (filtering only).</p> </li> + <li> <p><strong>ConfigQuery<String> jsonInfo()</strong> returns a query that converts a Configuration into a JSON formatted String representation.</p> </li> + </ul> + </div> + </div> + <div class="sect3"> + <h4 id="_functions_on_propertysourcefunctions">Functions on PropertySourceFunctions</h4> + <div class="paragraph"> + <p>The following sections explain the provided functions defined by PropertySourceFunctions singleton.</p> + </div> + <div class="ulist"> + <ul> + <li> <p><strong>PropertySource addMetaData(PropertySource propertySource, Map<String,String> metaData)</strong> Creates a new PropertySource with the given metadata added.</p> </li> + <li> <p><strong>boolean isKeyInSection(String key, String sectionKey)</strong> Checks if the given <em>key</em> is a direct or indirect member of one of the given <em>sectionKey</em>.</p> </li> + <li> <p><strong>boolean isKeyInSections(String key, Stringâ¦â sectionKeys)</strong> Checks if the given <em>key</em> is a direct or indirect member of one of one of the given <em>sectionKeys</em>.</p> </li> + <li> <p><strong>Set<String> sections(Map<String, String> properties)</strong> Extracts the sections from the given properties.</p> </li> + <li> <p><strong>Set<String> transitiveSections(Map<String, String> properties)</strong> Extracts the transitive sections from the given properties.</p> </li> + <li> <p><strong>Set<String> sections(Map<String, String> properties, final Predicate<String> predicate)</strong> Extracts the sections from the given properties, also filtering with the given predicate.</p> </li> + <li> <p><strong>Set<String> transitiveSections(Map<String, String> properties, Predicate<String> predicate)</strong> Extracts the transitive sections from the given properties, also filtering with the given predicate.</p> </li> + <li> <p><strong>Map<String,String> sectionsRecursive(Map<String, String> properties, Stringâ¦â sectionKeys)</strong> Creates w PropertySource only containing the sections that a direct or indirect children of the given <em>sectionKeys</em>.</p> </li> + <li> <p><strong>Map<String,String> sectionRecursive(Map<String, String> properties, boolean stripKeys, Stringâ¦â sectionKeys)</strong> Creates w PropertySource only containing the sections that a direct or indirect children of the given <em>sectionKeys</em>. With <em>stripKeys</em> one can select of the returned values should be relative to its selection of be fully qualified.</p> </li> + <li> <p><strong>String stripSectionKeys(String key, Stringâ¦â sectionKeys)</strong> This function strips away the matching section key as given in <em>sectionKeys</em> from a given <em>key</em>.</p> </li> + </ul> + </div> + </div> + </div> + </div> </div></p> <hr /> @@ -310,8 +233,8 @@ in <em>sectionKeys</em> from a given <em>key</em>.</p> <div id="footer"> <div class="container"> <p class="muted credit">© 2014-<span>2018</span> Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> - | Baked with <a href="http://jbake.org">JBake <span>v2.5.1</span></a> - at <span>2018-05-03</span> | + | Baked with <a href="http://jbake.org">JBake <span>v2.6.1</span></a> + at <span>2018-05-17</span> | <a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/tamayaconf">Follow @tamayaconf</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> </p> <p>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/cddd52a8/documentation/extensions/mod_hazelcast.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_hazelcast.html b/documentation/extensions/mod_hazelcast.html index 4e105b9..3878809 100644 --- a/documentation/extensions/mod_hazelcast.html +++ b/documentation/extensions/mod_hazelcast.html @@ -125,81 +125,69 @@ <h1>Apache Tamaya - Extension: Integration with Hazelcast</h1> </div> - <p><em>2018-04-26</em></p> + <p><em>2018-05-17</em></p> - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Consul">Integration with Hazelcast (Extension Module)</h2> -<div class="sectionbody"> -<div class="paragraph"> -<p>Tamaya <em>Hazelcast</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> -</div> -<div class="sect2"> -<h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> -<div class="paragraph"> -<p>Tamaya <em>Hazelcast</em> provides a property source which uses -<a href="http://www.hazelcast.org">Hazelcast</a> as configuration backend. Hereby the -module supports read-only integration (as a HazelcastPropertySource as well -as a writing configuration changes back (based on Tamaya’s MutableConfiguration API -defined by the <a href="mod_mutable_config.html">tamaya-mutable-config</a> extension module.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_compatibility">Compatibility</h3> -<div class="paragraph"> -<p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>To use <em>tamaya-hazelcast</em> you only must add the corresponding dependency to your module:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <p><div id="preamble"> + <div class="sectionbody"> + <!-- toc disabled --> + </div> +</div> +<div class="sect1"> + <h2 id="Consul">Integration with Hazelcast (Extension Module)</h2> + <div class="sectionbody"> + <div class="paragraph"> + <p>Tamaya <em>Hazelcast</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> + </div> + <div class="sect2"> + <h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> + <div class="paragraph"> + <p>Tamaya <em>Hazelcast</em> provides a property source which uses <a href="http://www.hazelcast.org">Hazelcast</a> as configuration backend. Hereby the module supports read-only integration (as a HazelcastPropertySource as well as a writing configuration changes back (based on Tamayaâs MutableConfiguration API defined by the <a href="mod_mutable_config.html">tamaya-mutable-config</a> extension module.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_compatibility">Compatibility</h3> + <div class="paragraph"> + <p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_installation">Installation</h3> + <div class="paragraph"> + <p>To use <em>tamaya-hazelcast</em> you only must add the corresponding dependency to your module:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> <groupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-hazelcast</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_the_extensions_provided">The Extensions Provided</h3> -<div class="paragraph"> -<p>Hazelcast integration comes basically with 2 artifacts:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>The org.apache.tamaya.hazelcast.HazelcastPropertySource is a PropertySource. The property source is not automatically -registered. Either register it using the <em>ServiceLoader</em> yourself or implement -and register a corresponding <code>PropertySourceProvider</code>.</p> -</li> -<li> -<p>If the tamaya-mutable-config module is loaded it is possible to write property values back into the consul cluster, -by accessing a MutableConfiguration using the URI config:hazelcast.</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>Access of consul key/value pairs is through the normal Tamaya API.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_the_hazelcastpropertysource">The HazelcastPropertySource</h3> -<div class="paragraph"> -<p>The HazelcastPropertySource is not automatically registered and provides different options how to integrate -Tamaya with Hazelcast.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">/** +</dependency></code></pre> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_the_extensions_provided">The Extensions Provided</h3> + <div class="paragraph"> + <p>Hazelcast integration comes basically with 2 artifacts:</p> + </div> + <div class="ulist"> + <ul> + <li> <p>The org.apache.tamaya.hazelcast.HazelcastPropertySource is a PropertySource. The property source is not automatically registered. Either register it using the <em>ServiceLoader</em> yourself or implement and register a corresponding <code>PropertySourceProvider</code>.</p> </li> + <li> <p>If the tamaya-mutable-config module is loaded it is possible to write property values back into the consul cluster, by accessing a MutableConfiguration using the URI config:hazelcast.</p> </li> + </ul> + </div> + <div class="paragraph"> + <p>Access of consul key/value pairs is through the normal Tamaya API.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_the_hazelcastpropertysource">The HazelcastPropertySource</h3> + <div class="paragraph"> + <p>The HazelcastPropertySource is not automatically registered and provides different options how to integrate Tamaya with Hazelcast.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">/** * Creates a new instance, hereby using {@code "Hazelcast"} as property source name and * a default hazelcast backend created by calling {@link Hazelcast#newHazelcastInstance()}. */ @@ -233,17 +221,15 @@ public HazelcastPropertySource(String name, Config config); * @param name * @param hazelcastInstance */ -public HazelcastPropertySource(String name, HazelcastInstance hazelcastInstance);</code></pre> -</div> -</div> -<div class="paragraph"> -<p>To use hazelcast as a configuration backend, you simply create the corresponding Hazelcast instance -and use it to initialize the Tamaya property source. Given that a hazelcast backedn configuration -can be easily created asillustrated below:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Config hazelcastConfig = new Config(); +public HazelcastPropertySource(String name, HazelcastInstance hazelcastInstance);</code></pre> + </div> + </div> + <div class="paragraph"> + <p>To use hazelcast as a configuration backend, you simply create the corresponding Hazelcast instance and use it to initialize the Tamaya property source. Given that a hazelcast backedn configuration can be easily created asillustrated below:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">Config hazelcastConfig = new Config(); // define config settings HazelcastInstance hazelcastInstance = Hazelcast.newInstance(hazelcastConfig); HazelcastPropertySource ps = new HazelcastPropertySource(hazelcastInstance); @@ -255,11 +241,11 @@ b.addDefaultPropertyConverters().addDefaultPropertyFilter().addDefaultPropertySo // Add the hazelcast property source (as most significant) b.addPropertySource(ps); // build and use the configuration -Configuration config = b.build();</code></pre> -</div> -</div> -</div> -</div> +Configuration config = b.build();</code></pre> + </div> + </div> + </div> + </div> </div></p> <hr /> @@ -271,8 +257,8 @@ Configuration config = b.build();</code></pre> <div id="footer"> <div class="container"> <p class="muted credit">© 2014-<span>2018</span> Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> - | Baked with <a href="http://jbake.org">JBake <span>v2.5.1</span></a> - at <span>2018-05-03</span> | + | Baked with <a href="http://jbake.org">JBake <span>v2.6.1</span></a> + at <span>2018-05-17</span> | <a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/tamayaconf">Follow @tamayaconf</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> </p> <p> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/cddd52a8/documentation/extensions/mod_injection.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_injection.html b/documentation/extensions/mod_injection.html index 8eaa9ea..7e64356 100644 --- a/documentation/extensions/mod_injection.html +++ b/documentation/extensions/mod_injection.html @@ -125,89 +125,81 @@ <h1>Apache Tamaya - Extension: Injection</h1> </div> - <p><em>2018-05-02</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Injection">Tamaya Injection (Extension Module)</h2> -<div class="sectionbody"> -<div class="paragraph"> -<p>Tamaya <em>Injection</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> -</div> -<div class="sect2"> -<h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> -<div class="paragraph"> -<p>Tamaya <em>Injection</em> provides functionality for injecting configured values into beans, or creating configuration -template instances.</p> -</div> -<div class="paragraph"> -<p>Inversion of Control (aka IoC/the Hollywood Principle) has proven to be very useful and effective in avoiding boilerplate -code. In Java there are different frameworks available that all provide IoC mechanisms. Unfortunately IoC is not a -built-in language feature. So for a portable solution that works also in Java SE Tamaya itself has to provide the -according injection services. This module adds this functionality to Tamaya.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_compatibility">Compatibility</h3> -<div class="paragraph"> -<p>The module is based on Java 7, so it can be used with Java 7 and beyond.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>Basically Tamaya’s injection API is deployed as API artifact:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <p><em>2018-05-17</em></p> + + <p><div id="preamble"> + <div class="sectionbody"> + <!-- toc disabled --> + </div> +</div> +<div class="sect1"> + <h2 id="Injection">Tamaya Injection (Extension Module)</h2> + <div class="sectionbody"> + <div class="paragraph"> + <p>Tamaya <em>Injection</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> + </div> + <div class="sect2"> + <h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> + <div class="paragraph"> + <p>Tamaya <em>Injection</em> provides functionality for injecting configured values into beans, or creating configuration template instances.</p> + </div> + <div class="paragraph"> + <p>Inversion of Control (aka IoC/the Hollywood Principle) has proven to be very useful and effective in avoiding boilerplate code. In Java there are different frameworks available that all provide IoC mechanisms. Unfortunately IoC is not a built-in language feature. So for a portable solution that works also in Java SE Tamaya itself has to provide the according injection services. This module adds this functionality to Tamaya.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_compatibility">Compatibility</h3> + <div class="paragraph"> + <p>The module is based on Java 7, so it can be used with Java 7 and beyond.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_installation">Installation</h3> + <div class="paragraph"> + <p>Basically Tamayaâs injection API is deployed as API artifact:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> <groupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-injection-api</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -<div class="paragraph"> -<p>To use injection with Java SE you must add the corresponding dependency to your module:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> +</dependency></code></pre> + </div> + </div> + <div class="paragraph"> + <p>To use injection with Java SE you must add the corresponding dependency to your module:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> <groupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-injection</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -<div class="paragraph"> -<p>Similarly there are other injection implementations available, targetig platforms such as</p> -</div> -<div class="ulist"> -<ul> -<li> -<p><a href="mod_spring.html">Spring, Spring Boot</a></p> -</li> -<li> -<p><a href="mod_CDI.html">Java EE/CDI</a></p> -</li> -</ul> -</div> -</div> -<div class="sect2"> -<h3 id="_core_concepts">Core Concepts</h3> -<div class="paragraph"> -<p>Basically you annotate fields or methods in your beans with @Config to enable configuration injection. Tamaya -additionally defines further annotations that allo you to define additional aspects such as default values, custom -converters etc. The following example illustrates the basic functionality:</p> -</div> -<div class="listingblock"> -<div class="title">Annotated Example Class</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">package foo.bar; +</dependency></code></pre> + </div> + </div> + <div class="paragraph"> + <p>Similarly there are other injection implementations available, targetig platforms such as</p> + </div> + <div class="ulist"> + <ul> + <li> <p><a href="mod_spring.html">Spring, Spring Boot</a></p> </li> + <li> <p><a href="mod_CDI.html">Java EE/CDI</a></p> </li> + </ul> + </div> + </div> + <div class="sect2"> + <h3 id="_core_concepts">Core Concepts</h3> + <div class="paragraph"> + <p>Basically you annotate fields or methods in your beans with @Config to enable configuration injection. Tamaya additionally defines further annotations that allo you to define additional aspects such as default values, custom converters etc. The following example illustrates the basic functionality:</p> + </div> + <div class="listingblock"> + <div class="title"> + Annotated Example Class + </div> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">package foo.bar; public class ConfiguredClass { @@ -237,17 +229,18 @@ public class ConfiguredClass { private BigDecimal bigNumber; ... -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>When configuring data or configuration classes it is also possible to auto-inject the fields identified. For activating -this feature a class must be annotated with @ConfigAutoInject:</p> -</div> -<div class="listingblock"> -<div class="title">An autoinjected bean class</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">package a.b; +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>When configuring data or configuration classes it is also possible to auto-inject the fields identified. For activating this feature a class must be annotated with @ConfigAutoInject:</p> + </div> + <div class="listingblock"> + <div class="title"> + An autoinjected bean class + </div> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">package a.b; @ConfigAutoInject public final class Tenant { @@ -266,216 +259,196 @@ public final class Tenant { public String getDescription(){ return description; } -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>These examples do not show all possibilities provided. Configuring instance of these -class using Tamaya is very simple: Just pass the instance to Tamaya to let -Tamaya inject the configuration (or throw a ConfigException, if this is not possible):</p> -</div> -<div class="listingblock"> -<div class="title">Configuring the ConfiguredClass Instance</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">ConfiguredClass classInstance = new ConfiguredClass(); +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>These examples do not show all possibilities provided. Configuring instance of these class using Tamaya is very simple: Just pass the instance to Tamaya to let Tamaya inject the configuration (or throw a ConfigException, if this is not possible):</p> + </div> + <div class="listingblock"> + <div class="title"> + Configuring the ConfiguredClass Instance + </div> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">ConfiguredClass classInstance = new ConfiguredClass(); ConfigurationInjector.configure(configuredClass); Tenant tenant = new Tenant(); -ConfigurationInjector.configure(tenant);</code></pre> -</div> -</div> -<div class="admonitionblock note"> -<table> -<tr> -<td class="icon"> -<div class="title">Note</div> -</td> -<td class="content"> -Configuration injection works similarly, when used with other integration modules, e.g. when Tamaya is used -with CDI, Spring or within an OSGI container. For further details refer also to the corresponding integration module’s -documentation. -</td> -</tr> -</table> -</div> -<div class="sect3"> -<h4 id="_the_configurationinjector">The ConfigurationInjector</h4> -<div class="paragraph"> -<p>The ConfigurationInjector interface provides methods that allow any kind of instances to be configured -by passing the instances to T ConfigurationInjector.getInstance().configure(T);. The classes passed -hereby must not be annotated with @Config for being configurable.</p> -</div> -</div> -<div class="sect3"> -<h4 id="_accessing_supplier_instances">Accessing Supplier instances</h4> -<div class="paragraph"> -<p>In many cases you want to create a supplier that simply creates instances that are correctly configured as defined -by the current context. This can be done using Suppliers:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier( +ConfigurationInjector.configure(tenant);</code></pre> + </div> + </div> + <div class="admonitionblock note"> + <table> + <tbody> + <tr> + <td class="icon"> + <div class="title"> + Note + </div> </td> + <td class="content"> Configuration injection works similarly, when used with other integration modules, e.g. when Tamaya is used with CDI, Spring or within an OSGI container. For further details refer also to the corresponding integration moduleâs documentation. </td> + </tr> + </tbody> + </table> + </div> + <div class="sect3"> + <h4 id="_the_configurationinjector">The ConfigurationInjector</h4> + <div class="paragraph"> + <p>The ConfigurationInjector interface provides methods that allow any kind of instances to be configured by passing the instances to T ConfigurationInjector.getInstance().configure(T);. The classes passed hereby must not be annotated with @Config for being configurable.</p> + </div> + </div> + <div class="sect3"> + <h4 id="_accessing_supplier_instances">Accessing Supplier instances</h4> + <div class="paragraph"> + <p>In many cases you want to create a supplier that simply creates instances that are correctly configured as defined by the current context. This can be done using Suppliers:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier( new Supplier<Tenant>(){ public Tenant get(){ return new Tenant(); } -});</code></pre> -</div> -</div> -<div class="paragraph"> -<p>With Java 8 it’s even more simple:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier( - Tenant::new);</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Hereby this annotation can be used in multiple ways and combined with other annotations such as -@WithLoadPolicy, @WithConfigOperator, @WithPropertyConverter.</p> -</div> -</div> -<div class="sect3"> -<h4 id="_minimal_example">Minimal Example</h4> -<div class="paragraph"> -<p>To illustrate the mechanism below the most simple variant of a configured class is given:</p> -</div> -<div class="listingblock"> -<div class="title">Most simple configured class</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ +});</code></pre> + </div> + </div> + <div class="paragraph"> + <p>With Java 8 itâs even more simple:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">Supplier<Tenant> configuredTenantSupplier = ConfigurationInjector.getInstance().getConfiguredSupplier( + Tenant::new);</code></pre> + </div> + </div> + <div class="paragraph"> + <p>Hereby this annotation can be used in multiple ways and combined with other annotations such as @WithLoadPolicy, @WithConfigOperator, @WithPropertyConverter.</p> + </div> + </div> + <div class="sect3"> + <h4 id="_minimal_example">Minimal Example</h4> + <div class="paragraph"> + <p>To illustrate the mechanism below the most simple variant of a configured class is given:</p> + </div> + <div class="listingblock"> + <div class="title"> + Most simple configured class + </div> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ @Config private String aValue; -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>When this class is configured, e.g. by passing it to ConfigurationInjector.getInstance().configure(Object), -the following is happening:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>The current valid Configuration is evaluated by calling Configuration cfg = ConfigurationProvider.getConfiguration();</p> -</li> -<li> -<p>The current property value (String) is evaluated by calling cfg.get("aValue"); for each possible key (mutliple -keys are possible).</p> -</li> -<li> -<p>if not successful, an error is thrown (ConfigException)</p> -</li> -<li> -<p>On success, since no type conversion is involved, the value is injected.</p> -</li> -</ul> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_the_annotations_in_detail">The Annotations in detail</h3> -<div class="sect3"> -<h4 id="_using_code_config_code">Using <code>@Config</code></h4> -<div class="paragraph"> -<p>This is the main annotation targeting a field in a class for configuration injection.</p> -</div> -<div class="sect4"> -<h5 id="_evaluating_of_em_configuration_keys_em">Evaluating of <em>configuration keys</em></h5> -<div class="paragraph"> -<p>By default Tamaya tries to determine configuration for each property of an instance -passed, using the following resolution policy:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>Given a class a.b.MyClass and a field myField it would try to look up the -following keys:</p> -</li> -</ul> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.MyClass.myField +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>When this class is configured, e.g. by passing it to ConfigurationInjector.getInstance().configure(Object), the following is happening:</p> + </div> + <div class="ulist"> + <ul> + <li> <p>The current valid Configuration is evaluated by calling Configuration cfg = ConfigurationProvider.getConfiguration();</p> </li> + <li> <p>The current property value (String) is evaluated by calling cfg.get("aValue"); for each possible key (mutliple keys are possible).</p> </li> + <li> <p>if not successful, an error is thrown (ConfigException)</p> </li> + <li> <p>On success, since no type conversion is involved, the value is injected.</p> </li> + </ul> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_the_annotations_in_detail">The Annotations in detail</h3> + <div class="sect3"> + <h4 id="_using_code_config_code">Using <code>@Config</code></h4> + <div class="paragraph"> + <p>This is the main annotation targeting a field in a class for configuration injection.</p> + </div> + <div class="sect4"> + <h5 id="_evaluating_of_em_configuration_keys_em">Evaluating of <em>configuration keys</em></h5> + <div class="paragraph"> + <p>By default Tamaya tries to determine configuration for each property of an instance passed, using the following resolution policy:</p> + </div> + <div class="ulist"> + <ul> + <li> <p>Given a class a.b.MyClass and a field myField it would try to look up the following keys:</p> </li> + </ul> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.MyClass.myField a.b.MyClass.my-field MyClass.myField MyClass.my-field myField -my-field</code></pre> -</div> -</div> -<div class="paragraph"> -<p>This behaviour can be adapted, e.g. by using the <code>@ConfigDefaultSections</code> annotation on the -declaring type:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre>@ConfigDefaultSections("a.b.c", "deprecated") +my-field</code></pre> + </div> + </div> + <div class="paragraph"> + <p>This behaviour can be adapted, e.g. by using the <code>@ConfigDefaultSections</code> annotation on the declaring type:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre>@ConfigDefaultSections("a.b.c", "deprecated") pubic class MyClass{ @Config private String myField; -}</pre> -</div> -</div> -<div class="paragraph"> -<p>This will result in a modified lookup chain as illustrated below:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.c.myField +}</pre> + </div> + </div> + <div class="paragraph"> + <p>This will result in a modified lookup chain as illustrated below:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.c.myField a.b.c.my-field deprecated.myField -deprecated.my-field</code></pre> -</div> -</div> -<div class="paragraph"> -<p>This helps to reduce redundancy when referring to you configuration keys. Additionally -it is also possible to define absolute key entries, e.g.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre>@ConfigDefaultSections("a.b.c") +deprecated.my-field</code></pre> + </div> + </div> + <div class="paragraph"> + <p>This helps to reduce redundancy when referring to you configuration keys. Additionally it is also possible to define absolute key entries, e.g.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre>@ConfigDefaultSections("a.b.c") pubic class MyClass{ @Config("myField" /* relative */, "[absolute.key]") private String myField; -}</pre> -</div> -</div> -<div class="paragraph"> -<p>This will result in a lookup chain as illustrated below:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.c.myField -absolute.key # default sections are ignored</code></pre> -</div> -</div> -</div> -<div class="sect4"> -<h5 id="_using_defaults">Using defaults</h5> -<div class="paragraph"> -<p>In the next example we explicitly define the <em>default</em> property value:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ +}</pre> + </div> + </div> + <div class="paragraph"> + <p>This will result in a lookup chain as illustrated below:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">a.b.c.myField +absolute.key # default sections are ignored</code></pre> + </div> + </div> + </div> + <div class="sect4"> + <h5 id="_using_defaults">Using defaults</h5> + <div class="paragraph"> + <p>In the next example we explicitly define the <em>default</em> property value:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ @Config(value={"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}") private String aValue; -}</code></pre> -</div> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_automatically_inject_all_items_using_code_configautoinject_code">Automatically inject all items using <code>@ConfigAutoInject</code></h4> -<div class="paragraph"> -<p>Using <code>@ConfigAutoInject</code> allows you to automatically select all properties found for -configuration injection:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@ConfigAutoInject +}</code></pre> + </div> + </div> + </div> + </div> + <div class="sect3"> + <h4 id="_automatically_inject_all_items_using_code_configautoinject_code">Automatically inject all items using <code>@ConfigAutoInject</code></h4> + <div class="paragraph"> + <p>Using <code>@ConfigAutoInject</code> allows you to automatically select all properties found for configuration injection:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">@ConfigAutoInject pubic class ConfiguredItem{ private transient int sum; @@ -483,84 +456,76 @@ pubic class ConfiguredItem{ private String a; private String b; Private String c; -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Adding the <code>@NoConfig</code> annotation prevents a field or method to be auto-injected from -configuration. This is especially useful, if a type is annotated as @ConfigAutoInject with auto-confiuration -turned on as follows:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@NoConfig -private transient int sum;</code></pre> -</div> -</div> -<div class="paragraph"> -<p>In this case the fields a,b,c are configured, whereas the field sum is ignored regarding -configuration.</p> -</div> -</div> -<div class="sect3"> -<h4 id="_adding_custom_operators_using_code_withconfigoperator_code">Adding custom operators using <code>@WithConfigOperator</code></h4> -<div class="paragraph"> -<p>The @WithConfigOperator annotation allows you define a class of type ConfigOperator, to being applied -to the final Configuration, BEFORE the value is injected. This can be used for various use cases, e.g. -filtering or validating the visible properties for a certain use case.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@WithConfigOperator(MyConfigView.class) +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>Adding the <code>@NoConfig</code> annotation prevents a field or method to be auto-injected from configuration. This is especially useful, if a type is annotated as @ConfigAutoInject with auto-confiuration turned on as follows:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">@NoConfig +private transient int sum;</code></pre> + </div> + </div> + <div class="paragraph"> + <p>In this case the fields a,b,c are configured, whereas the field sum is ignored regarding configuration.</p> + </div> + </div> + <div class="sect3"> + <h4 id="_adding_custom_operators_using_code_withconfigoperator_code">Adding custom operators using <code>@WithConfigOperator</code></h4> + <div class="paragraph"> + <p>The @WithConfigOperator annotation allows you define a class of type ConfigOperator, to being applied to the final Configuration, BEFORE the value is injected. This can be used for various use cases, e.g. filtering or validating the visible properties for a certain use case.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">@WithConfigOperator(MyConfigView.class) pubic class ConfiguredItem{ @Config private String a; -}</code></pre> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_adding_custom_property_converters_using_code_withpropertyconverter_code">Adding custom property converters using <code>@WithPropertyConverter</code></h4> -<div class="paragraph"> -<p>The @WithPropertyConverter annotation allows you to define a class of type PropertyConverter, to be applied -on a property configured to convert the String value to the expected injected type. This can be used for -various use cases, e.g. adding custom formats, config models, decryption.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ +}</code></pre> + </div> + </div> + </div> + <div class="sect3"> + <h4 id="_adding_custom_property_converters_using_code_withpropertyconverter_code">Adding custom property converters using <code>@WithPropertyConverter</code></h4> + <div class="paragraph"> + <p>The @WithPropertyConverter annotation allows you to define a class of type PropertyConverter, to be applied on a property configured to convert the String value to the expected injected type. This can be used for various use cases, e.g. adding custom formats, config models, decryption.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ @WithPropertyConverter(MyPropertyConverter.class) @Config private String a; -}</code></pre> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_inject_a_code_dynamicvalue_code">Inject a <code>DynamicValue</code></h4> -<div class="paragraph"> -<p>Within this example we evaluate a dynamic value. This mechanism allows you to listen for configuration changes and to -commit new values exactly, when convenient for you.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ +}</code></pre> + </div> + </div> + </div> + <div class="sect3"> + <h4 id="_inject_a_code_dynamicvalue_code">Inject a <code>DynamicValue</code></h4> + <div class="paragraph"> + <p>Within this example we evaluate a dynamic value. This mechanism allows you to listen for configuration changes and to commit new values exactly, when convenient for you.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">pubic class ConfiguredItem{ @Config(value={"aValue", "a.b.value","a.b.deprecated.value"}, defaultValue="${env:java.version}") private DynamicValue aValue; -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>The DynamicValue provides you the following functionality:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface DynamicValue<T> { +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>The DynamicValue provides you the following functionality:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface DynamicValue<T> { T get(); T getNewValue(); @@ -588,38 +553,30 @@ public enum UpdatePolicy{ EXPLCIT, NEVER, LOG_AND_DISCARD -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Summarizing a DynamicValue allows you</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>to reload actively updates of configured values.</p> -</li> -<li> -<p>update implicitly or explicitly all changes on the value.</p> -</li> -<li> -<p>add listeners that observe changes of a certain value.</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>Dynamic values also allow on-the-fly reevaluation of the value by calling evaluateValue(). Hereby the value of the -instance is not changed.</p> -</div> -<div class="sect4"> -<h5 id="_the_loading_policy_enum">The Loading policy enum</h5> -<div class="paragraph"> -<p>The LoadPolicy enum defines different configuration loading behaviour -to be applied:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@Deprecated +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>Summarizing a DynamicValue allows you</p> + </div> + <div class="ulist"> + <ul> + <li> <p>to reload actively updates of configured values.</p> </li> + <li> <p>update implicitly or explicitly all changes on the value.</p> </li> + <li> <p>add listeners that observe changes of a certain value.</p> </li> + </ul> + </div> + <div class="paragraph"> + <p>Dynamic values also allow on-the-fly reevaluation of the value by calling evaluateValue(). Hereby the value of the instance is not changed.</p> + </div> + <div class="sect4"> + <h5 id="_the_loading_policy_enum">The Loading policy enum</h5> + <div class="paragraph"> + <p>The LoadPolicy enum defines different configuration loading behaviour to be applied:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">@Deprecated public enum LoadPolicy { /** * The configuration keys is evaluated once, when the owning component is loaded/configured, but never updated later. @@ -635,41 +592,33 @@ public enum LoadPolicy { * The configuration value is evaluated every time it is accessed. */ ALWAYS -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>This enum type currently is used only internally, so avoid using it as of -now in your code is recommended.</p> -</div> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_configuration_events">Configuration Events</h3> -<div class="paragraph"> -<p>Similar to CDI Tamaya publishes Configuration events, when instances were configured. It depends on the effective -event backend in use, if and how events are published:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>when you have the CDI extension active events are published using the default CDI event mechanism.</p> -</li> -<li> -<p>in all other scenarios events are delegated to the tamaya-events module, if available,</p> -</li> -<li> -<p>if no event delegation is available no events are published.</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>The event published is very simple:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ConfiguredType { +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>This enum type currently is used only internally, so avoid using it as of now in your code is recommended.</p> + </div> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_configuration_events">Configuration Events</h3> + <div class="paragraph"> + <p>Similar to CDI Tamaya publishes Configuration events, when instances were configured. It depends on the effective event backend in use, if and how events are published:</p> + </div> + <div class="ulist"> + <ul> + <li> <p>when you have the CDI extension active events are published using the default CDI event mechanism.</p> </li> + <li> <p>in all other scenarios events are delegated to the tamaya-events module, if available,</p> </li> + <li> <p>if no event delegation is available no events are published.</p> </li> + </ul> + </div> + <div class="paragraph"> + <p>The event published is very simple:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ConfiguredType { Class getType(); String getName(); Collection<ConfiguredField> getConfiguredFields(); @@ -695,11 +644,11 @@ public interface ConfiguredMethod { String getSignature(); void configure(Object instance, Configuration config); } -----------------------------------------</code></pre> -</div> -</div> -</div> -</div> +----------------------------------------</code></pre> + </div> + </div> + </div> + </div> </div></p> <hr /> @@ -711,8 +660,8 @@ public interface ConfiguredMethod { <div id="footer"> <div class="container"> <p class="muted credit">© 2014-<span>2018</span> Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> - | Baked with <a href="http://jbake.org">JBake <span>v2.5.1</span></a> - at <span>2018-05-03</span> | + | Baked with <a href="http://jbake.org">JBake <span>v2.6.1</span></a> + at <span>2018-05-17</span> | <a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/tamayaconf">Follow @tamayaconf</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> </p> <p> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/cddd52a8/documentation/extensions/mod_jndi.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_jndi.html b/documentation/extensions/mod_jndi.html index c5ffa2d..3d456f4 100644 --- a/documentation/extensions/mod_jndi.html +++ b/documentation/extensions/mod_jndi.html @@ -125,57 +125,54 @@ <h1>Apache Tamaya - Extension: Integration with JNDI</h1> </div> - <p><em>2018-04-26</em></p> + <p><em>2018-05-17</em></p> - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="JNDI">Integration with JNDI (Extension Module)</h2> -<div class="sectionbody"> -<div class="paragraph"> -<p>Tamaya <em>JNDI</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> -</div> -<div class="sect2"> -<h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> -<div class="paragraph"> -<p>Tamaya <em>JNDI</em> provides a simple PropertySource that reads values from a -JNDI context.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_compatibility">Compatibility</h3> -<div class="paragraph"> -<p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>To use <em>jndi</em> as a configuration backend you only must add the corresponding dependency to -your module:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <p><div id="preamble"> + <div class="sectionbody"> + <!-- toc disabled --> + </div> +</div> +<div class="sect1"> + <h2 id="JNDI">Integration with JNDI (Extension Module)</h2> + <div class="sectionbody"> + <div class="paragraph"> + <p>Tamaya <em>JNDI</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> + </div> + <div class="sect2"> + <h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> + <div class="paragraph"> + <p>Tamaya <em>JNDI</em> provides a simple PropertySource that reads values from a JNDI context.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_compatibility">Compatibility</h3> + <div class="paragraph"> + <p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_installation">Installation</h3> + <div class="paragraph"> + <p>To use <em>jndi</em> as a configuration backend you only must add the corresponding dependency to your module:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> <groupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-jndi</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_the_functionality_provided">The Functionality Provided</h3> -<div class="paragraph"> -<p>Main artifact is the JNDIPropertySource class, which implements a -property source based on a JNDI context:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public class JNDIPropertySource extends BasePropertySource { +</dependency></code></pre> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_the_functionality_provided">The Functionality Provided</h3> + <div class="paragraph"> + <p>Main artifact is the JNDIPropertySource class, which implements a property source based on a JNDI context:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">public class JNDIPropertySource extends BasePropertySource { public JNDIPropertySource(String name, Context context); public JNDIPropertySource(String name) throws NamingException; @@ -184,26 +181,20 @@ property source based on a JNDI context:</p> public void setScannable(boolean scannable); [...] -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>By default the property source is <em>non scannable</em>, so a call the <code>getProperties()</code> -will return an empty map instance. After calling <code>setScannable(true);</code> a call to -<code>getProperties()</code> will return a String representation of the JNDI tree. Hereby -leaves of the tree are converted using <code>String.valueOf(leaveObject)</code>.</p> -</div> -<div class="paragraph"> -<p>This module automatically registers an instance of JNDIPropertySource with a -default ordinal of 200.</p> -</div> -<div class="paragraph"> -<p>You can extend this class or manually instantiate it, e.g. as part of a -PropertySourceProvider. If no <code>Context</code> is passed explicitly, a new -InitialContext is created, without any environment parameters set.</p> -</div> -</div> -</div> +}</code></pre> + </div> + </div> + <div class="paragraph"> + <p>By default the property source is <em>non scannable</em>, so a call the <code>getProperties()</code> will return an empty map instance. After calling <code>setScannable(true);</code> a call to <code>getProperties()</code> will return a String representation of the JNDI tree. Hereby leaves of the tree are converted using <code>String.valueOf(leaveObject)</code>.</p> + </div> + <div class="paragraph"> + <p>This module automatically registers an instance of JNDIPropertySource with a default ordinal of 200.</p> + </div> + <div class="paragraph"> + <p>You can extend this class or manually instantiate it, e.g. as part of a PropertySourceProvider. If no <code>Context</code> is passed explicitly, a new InitialContext is created, without any environment parameters set.</p> + </div> + </div> + </div> </div></p> <hr /> @@ -215,8 +206,8 @@ InitialContext is created, without any environment parameters set.</p> <div id="footer"> <div class="container"> <p class="muted credit">© 2014-<span>2018</span> Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> - | Baked with <a href="http://jbake.org">JBake <span>v2.5.1</span></a> - at <span>2018-05-03</span> | + | Baked with <a href="http://jbake.org">JBake <span>v2.6.1</span></a> + at <span>2018-05-17</span> | <a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/tamayaconf">Follow @tamayaconf</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> </p> <p> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/cddd52a8/documentation/extensions/mod_jodatime.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_jodatime.html b/documentation/extensions/mod_jodatime.html index 4101423..54126e4 100644 --- a/documentation/extensions/mod_jodatime.html +++ b/documentation/extensions/mod_jodatime.html @@ -125,162 +125,158 @@ <h1>Apache Tamaya - Extension: JodaTime</h1> </div> - <p><em>2018-04-26</em></p> + <p><em>2018-05-17</em></p> - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="JodaTime">Tamaya JodaTime (Extension Module)</h2> -<div class="sectionbody"> -<div class="paragraph"> -<p>Tamaya <em>JodaTime</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> -</div> -<div class="sect2"> -<h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> -<div class="paragraph"> -<p>Tamaya <em>JodaTime</em> is an extension module to support the usage of <a href="http://www.joda.org/joda-time/">Joda-Time</a> -in conjunction with Tamaya. Tamaya JodaTime defines some additional property -converters to use Joda-Time types when accessing configuration.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>To support Joda-Time types as configuration values, you only have to add the following -maven dependency to your project:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing"><dependency> + <p><div id="preamble"> + <div class="sectionbody"> + <!-- toc disabled --> + </div> +</div> +<div class="sect1"> + <h2 id="JodaTime">Tamaya JodaTime (Extension Module)</h2> + <div class="sectionbody"> + <div class="paragraph"> + <p>Tamaya <em>JodaTime</em> is an extension module. Refer to the <a href="../extensions.html">extensions documentation</a> for further details.</p> + </div> + <div class="sect2"> + <h3 id="_what_functionality_this_module_provides">What functionality this module provides ?</h3> + <div class="paragraph"> + <p>Tamaya <em>JodaTime</em> is an extension module to support the usage of <a href="http://www.joda.org/joda-time/">Joda-Time</a> in conjunction with Tamaya. Tamaya JodaTime defines some additional property converters to use Joda-Time types when accessing configuration.</p> + </div> + </div> + <div class="sect2"> + <h3 id="_installation">Installation</h3> + <div class="paragraph"> + <p>To support Joda-Time types as configuration values, you only have to add the following maven dependency to your project:</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-listing" data-lang="listing"><dependency> <grooupId>org.apache.tamaya.ext</groupId> <artifactId>tamaya-jodatime</artifactId> <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_usage">Usage</h3> -<div class="paragraph"> -<p>After adding this module to your project you can retrieve -Joda-Time based values directly from a given configuration.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Configuration configuration = ConfigurationProvider.getConfiguration(); +</dependency></code></pre> + </div> + </div> + </div> + <div class="sect2"> + <h3 id="_usage">Usage</h3> + <div class="paragraph"> + <p>After adding this module to your project you can retrieve Joda-Time based values directly from a given configuration.</p> + </div> + <div class="listingblock"> + <div class="content"> + <pre class="prettyprint highlight"><code class="language-java" data-lang="java">Configuration configuration = ConfigurationProvider.getConfiguration(); -DateTime pit = configuration.get("pointInTime", DateTime.class)</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Currently the following types are supported:</p> -</div> -<table class="tableblock frame-all grid-all" style="width: 80%;"> -<colgroup> -<col style="width: 50%;"> -<col style="width: 50%;"> -</colgroup> -<thead> -<tr> -<th class="tableblock halign-left valign-top">Joda-Time target type</th> -<th class="tableblock halign-left valign-top">Supported Input Formats</th> -</tr> -</thead> -<tbody> -<tr> -<td class="tableblock halign-center valign-top" rowspan="12"><p class="tableblock">org.joda.time.DateTime org.joda.time.Instant</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ss.SSSZ</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ss.SSSz</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ss.SSS z</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ssZ</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ssz</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm:ss z</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mmZ</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mmz</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH:mm z</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HHZ</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HHz</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-dd’T’HH z</code></p></td> -</tr> -<tr> -<td class="tableblock halign-center valign-top" rowspan="2"><p class="tableblock">org.joda.time.DateTimeZone</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>[+-]hh:mm</code> (reg.ex.)</p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock">all <em>timezone ids</em> known by Joda-Time.</p></td> -</tr> -<tr> -<td class="tableblock halign-center valign-top" rowspan="3"><p class="tableblock">org.joda.time.Duration</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>PTa.bS</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>PdDThHmMsS</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>ddThh:mm:ss</code></p></td> -</tr> -<tr> -<td class="tableblock halign-center valign-top" rowspan="2"><p class="tableblock">org.joda.time.Period</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>PyYmMwWdDThHmMsS</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Pyyyy-mm-ddThh:mm:ss</code></p></td> -</tr> -<tr> -<td class="tableblock halign-center valign-top" rowspan="4"><p class="tableblock">org.joda.time.LocalDate</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' MM ['-' dd]]</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' DDD]</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>LocalDateConverter</code></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' dd ['-' MM]]</code></p></td> -</tr> -<tr> -<td class="tableblock halign-center valign-top" rowspan="4"><p class="tableblock">org.joda.time.LocalTime</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><code>['T']</code> <em>time-element</em></p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><em>time-element</em> = HH [<em>minute-element</em>] <em>or</em> [<em>fraction</em>]</p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><em>minute-element</em> = ':' mm [<em>second-element</em>] <em>or</em> [<em>fraction</em>]</p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-top"><p class="tableblock"><em>second-element</em> = ':' ss [<em>fraction</em>]</p></td> -</tr> -</tbody> -</table> -</div> -</div> +DateTime pit = configuration.get("pointInTime", DateTime.class)</code></pre> + </div> + </div> + <div class="paragraph"> + <p>Currently the following types are supported:</p> + </div> + <table class="tableblock frame-all grid-all" style="width: 80%;"> + <colgroup> + <col style="width: 50%;"> + <col style="width: 50%;"> + </colgroup> + <thead> + <tr> + <th class="tableblock halign-left valign-top">Joda-Time target type</th> + <th class="tableblock halign-left valign-top">Supported Input Formats</th> + </tr> + </thead> + <tbody> + <tr> + <td class="tableblock halign-center valign-top" rowspan="12"><p class="tableblock">org.joda.time.DateTime org.joda.time.Instant</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ss.SSSZ</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ss.SSSz</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ss.SSS z</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ssZ</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ssz</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm:ss z</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mmZ</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mmz</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH:mm z</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHHZ</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHHz</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy-MM-ddâTâHH z</code></p></td> + </tr> + <tr> + <td class="tableblock halign-center valign-top" rowspan="2"><p class="tableblock">org.joda.time.DateTimeZone</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>[+-]hh:mm</code> (reg.ex.)</p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock">all <em>timezone ids</em> known by Joda-Time.</p></td> + </tr> + <tr> + <td class="tableblock halign-center valign-top" rowspan="3"><p class="tableblock">org.joda.time.Duration</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>PTa.bS</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>PdDThHmMsS</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>ddThh:mm:ss</code></p></td> + </tr> + <tr> + <td class="tableblock halign-center valign-top" rowspan="2"><p class="tableblock">org.joda.time.Period</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>PyYmMwWdDThHmMsS</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>Pyyyy-mm-ddThh:mm:ss</code></p></td> + </tr> + <tr> + <td class="tableblock halign-center valign-top" rowspan="4"><p class="tableblock">org.joda.time.LocalDate</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' MM ['-' dd]]</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' DDD]</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>LocalDateConverter</code></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>yyyy ['-' dd ['-' MM]]</code></p></td> + </tr> + <tr> + <td class="tableblock halign-center valign-top" rowspan="4"><p class="tableblock">org.joda.time.LocalTime</p></td> + <td class="tableblock halign-left valign-top"><p class="tableblock"><code>['T']</code> <em>time-element</em></p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><em>time-element</em> = HH [<em>minute-element</em>] <em>or</em> [<em>fraction</em>]</p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><em>minute-element</em> = ':' mm [<em>second-element</em>] <em>or</em> [<em>fraction</em>]</p></td> + </tr> + <tr> + <td class="tableblock halign-left valign-top"><p class="tableblock"><em>second-element</em> = ':' ss [<em>fraction</em>]</p></td> + </tr> + </tbody> + </table> + </div> + </div> </div></p> <hr /> @@ -292,8 +288,8 @@ DateTime pit = configuration.get("pointInTime", DateTime.class)</code></pre> <div id="footer"> <div class="container"> <p class="muted credit">© 2014-<span>2018</span> Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> - | Baked with <a href="http://jbake.org">JBake <span>v2.5.1</span></a> - at <span>2018-05-03</span> | + | Baked with <a href="http://jbake.org">JBake <span>v2.6.1</span></a> + at <span>2018-05-17</span> | <a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/tamayaconf">Follow @tamayaconf</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> </p> <p>