You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2016/01/22 14:38:12 UTC

svn commit: r978304 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/models.html

Author: buildbot
Date: Fri Jan 22 13:38:11 2016
New Revision: 978304

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/models.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jan 22 13:38:11 2016
@@ -1 +1 @@
-1726023
+1726209

Modified: websites/staging/sling/trunk/content/documentation/bundles/models.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/models.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/models.html Fri Jan 22 13:38:11 2016
@@ -278,7 +278,6 @@ strategy by using adding <code>defaultIn
 
 <p>To still mark some fields/methods as being mandatory while relying on <code>defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL</code> for all other fields, the annotation <code>@Required</code> can be used.</p>
 <p><code>@Optional</code> annotations are only evaluated when using the <code>defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED</code> (which is the default), <code>@Required</code> annotations only if using <code>defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL</code>.</p>
-<p><em>The <code>defaultInjectionStrategy</code> is currently not considered for fields/methods annotated with Injector-specific annotations (see also <a href="https://issues.apache.org/jira/browse/SLING-4155">SLING-4155</a>)</em></p>
 <h2 id="defaults">Defaults<a class="headerlink" href="#defaults" title="Permanent link">&para;</a></h2>
 <p>A default value can be provided (for Strings &amp; primitives):</p>
 <div class="codehilite"><pre><span class="nd">@Model</span><span class="o">(</span><span class="n">adaptables</span><span class="o">=</span><span class="n">Resource</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
@@ -527,7 +526,7 @@ Validation is only supported on models w
 <td><code>script-bindings</code></td>
 <td>1000</td>
 <td>1.0.0</td>
-<td>Lookup objects in the script bindings object</td>
+<td>Lookup objects in the script bindings object by name.</td>
 <td>A ServletRequest object which has the <code>Sling Bindings</code> attribute defined</td>
 <td>no</td>
 <td>no conversion is done</td>
@@ -538,7 +537,7 @@ Validation is only supported on models w
 <td><code>valuemap</code></td>
 <td>2000</td>
 <td>1.0.0</td>
-<td>Gets a property from a <code>ValueMap</code></td>
+<td>Gets a property from a <code>ValueMap</code> by name.</td>
 <td>Any object which is or can be adapted to a <code>ValueMap</code></td>
 <td>no</td>
 <td>Primitive arrays wrapped/unwrapped as necessary. Wrapper object arrays are unwrapped/wrapped as necessary.</td>
@@ -549,7 +548,7 @@ Validation is only supported on models w
 <td><code>child-resources</code></td>
 <td>3000</td>
 <td>1.0.0</td>
-<td>Gets a child resource by name</td>
+<td>Gets a child resource by name.</td>
 <td><code>Resource</code> objects</td>
 <td>no</td>
 <td>none</td>
@@ -560,7 +559,7 @@ Validation is only supported on models w
 <td><code>request-attributes</code></td>
 <td>4000</td>
 <td>1.0.0</td>
-<td>Get a request attribute</td>
+<td>Get a request attribute by name.</td>
 <td><code>ServletRequest</code> objects</td>
 <td>no</td>
 <td>no conversion is done</td>
@@ -571,7 +570,7 @@ Validation is only supported on models w
 <td><code>osgi-services</code></td>
 <td>5000</td>
 <td>1.0.0</td>
-<td>Lookup services based on class name</td>
+<td>Lookup services based on class name.</td>
 <td>Any object</td>
 <td>yes</td>
 <td>yes</td>
@@ -582,7 +581,7 @@ Validation is only supported on models w
 <td><code>resource-path</code></td>
 <td>2500</td>
 <td>1.1.0</td>
-<td>Injects a resource by its path.</td>
+<td>Injects a resource by its path derived from the name.</td>
 <td><code>Resource</code> or <code>SlingHttpServletRequest</code> objects</td>
 <td>yes</td>
 <td>none</td>
@@ -633,48 +632,49 @@ the following advantages over using the
 <tbody>
 <tr>
 <td><code>@ScriptVariable</code></td>
-<td><code>optional</code> and <code>name</code></td>
+<td><code>injectionStrategy</code> and <code>name</code></td>
 <td><code>script-bindings</code></td>
 </tr>
 <tr>
 <td><code>@ValueMapValue</code></td>
-<td><code>optional</code>, <code>name</code> and <code>via</code></td>
+<td><code>injectionStrategy</code>, <code>name</code> and <code>via</code></td>
 <td><code>valuemap</code></td>
 </tr>
 <tr>
 <td><code>@ChildResource</code></td>
-<td><code>optional</code>, <code>name</code> and <code>via</code></td>
+<td><code>injectionStrategy</code>, <code>name</code> and <code>via</code></td>
 <td><code>child-resources</code></td>
 </tr>
 <tr>
 <td><code>@RequestAttribute</code></td>
-<td><code>optional</code>, <code>name</code> and <code>via</code></td>
+<td><code>injectionStrategy</code>, <code>name</code> and <code>via</code></td>
 <td><code>request-attributes</code></td>
 </tr>
 <tr>
 <td><code>@ResourcePath</code></td>
-<td><code>optional</code>, <code>path</code>, and <code>name</code></td>
+<td><code>injectionStrategy</code>, <code>path</code>, and <code>name</code></td>
 <td><code>resource-path</code></td>
 </tr>
 <tr>
 <td><code>@OSGiService</code></td>
-<td><code>optional</code>, <code>filter</code></td>
+<td><code>injectionStrategy</code>, <code>filter</code></td>
 <td><code>osgi-services</code></td>
 </tr>
 <tr>
 <td><code>@Self</code></td>
-<td><code>optional</code></td>
+<td><code>injectionStrategy</code></td>
 <td><code>self</code></td>
 </tr>
 <tr>
 <td><code>@SlingObject</code></td>
-<td><code>optional</code></td>
+<td><code>injectionStrategy</code></td>
 <td><code>sling-object</code></td>
 </tr>
 </tbody>
 </table>
 <h2 id="hints">Hints<a class="headerlink" href="#hints" title="Permanent link">&para;</a></h2>
-<p>Those annotations replace <code>@Via</code>, <code>@Filter</code>, <code>@Named</code>, <code>@Optional</code>, <code>@Required</code>, <code>@Source</code> and <code>@Inject</code>.
+<p>Those annotations replace <code>@Via</code>, <code>@Filter</code>, <code>@Named</code>, <code>@Optional</code>, <code>@Required</code>, <code>@Source</code> and <code>@Inject</code>. 
+Instead of using the deprecated annotation element <code>optional</code> you should rather use <code>injectionStrategy</code> with the values <code>DEFAULT</code>, <code>OPTIONAL</code> or <code>REQUIRED</code> (see also <a href="https://issues.apache.org/jira/browse/SLING-4155">SLING-4155</a>).
 <code>@Default</code> may still be used in addition to the injector-specific annotation to set default values. All elements given above are optional.</p>
 <h2 id="custom-annotations">Custom Annotations<a class="headerlink" href="#custom-annotations" title="Permanent link">&para;</a></h2>
 <p>To create a custom annotation, implement the <code>org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory</code> interface.
@@ -702,7 +702,7 @@ SPI interface which could use context to
 content path context. If multiple implementations of the <code>ImplementationPicker</code> interface are present, they are queried
 one after another in order of their service ranking property, the first one that picks an implementation wins.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1680764 by kwin on Thu, 21 May 2015 08:48:44 +0000
+        Rev. 1726209 by kwin on Fri, 22 Jan 2016 13:37:56 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project