Author: buildbot Date: Wed Dec 10 16:44:33 2014 New Revision: 932209 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 Wed Dec 10 16:44:33 2014 @@ -1 +1 @@ -1644388 +1644472 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 Wed Dec 10 16:44:33 2014 @@ -205,11 +205,11 @@ can be listed in a comma-separated list <p>As with other AdapterFactories, if the adaptation can't be made for any reason, <code>adaptTo()</code> returns null.</p> <h2 id="modelfactory-since-120">ModelFactory (since 1.2.0)</h2> -<p>Since Sling Models 1.2.0 (<a href="https://issues.apache.org/jira/browse/SLING-3709">SLING-3709</a>) there is another way of instanciating models. The OSGi service <code>ModelFactory</code> provides a method for instanciating a model that throws exceptions in case the model cannot be instanciated. That way <code>null</code> checks are not necessary.</p> +<p>Since Sling Models 1.2.0 (<a href="https://issues.apache.org/jira/browse/SLING-3709">SLING-3709</a>) there is another way of instantiating models. The OSGi service <code>ModelFactory</code> provides a method for instantiating a model that throws exceptions this is not possible. That way <code>null</code> checks are not necessary.</p> <div class="codehilite"><pre><span class="k">try</span> <span class="o">{</span> <span class="n">MyModel</span> <span class="n">model</span> <span class="o">=</span> <span class="n">modelFactory</span><span class="o">.</span><span class="na">createModel</span><span class="o">(</span><span class="n">resource</span><span class="o">,</span> <span class="n">MyModel</span><span class="o">.</span><span class="na">class</span><span class="o">);</span> <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span> - <span class="c1">// give out error message that the model could not be instanciated. </span> + <span class="c1">// give out error message that the model could not be instantiated. </span> <span class="c1">// The exception contains further information. </span> <span class="c1">// See the javadoc of the ModelFactory for which Exception can be expected here</span> <span class="o">}</span> @@ -435,27 +435,27 @@ strategy by using adding <code>defaultIn <tr> <td><code>DISABLED</code> (default)</td> <td>don't validate the resource bound to the Model</td> -<td>Model instanciated</td> -<td>Model instanciated</td> -<td>Model instanciated</td> +<td>Model instantiated</td> +<td>Model instantiated</td> +<td>Model instantiated</td> </tr> <tr> <td><code>REQUIRED</code></td> <td>enforce validation of the resource bound to the Model</td> -<td>Model not instanciated</td> -<td>Model not instanciated</td> -<td>Model not instanciated</td> +<td>Model not instantiated</td> +<td>Model not instantiated</td> +<td>Model not instantiated</td> </tr> <tr> <td><code>OPTIONAL</code></td> <td>validate the resource bound to the Model (if a validation model is found)</td> -<td>Model not instanciated</td> -<td>Model instanciated</td> -<td>Model not instanciated</td> +<td>Model not instantiated</td> +<td>Model instantiated</td> +<td>Model not instantiated</td> </tr> </tbody> </table> -<p>In case the model is not instanciated an appropriate error message is logged (if the model is instanciated through the <code>adaptTo()</code> method or an appropriate exception is thrown if the model is instanciated through <code>ModelFactory.createModel()</code>). +<p>In case the model is not instantiated an appropriate error message is logged (if <code>adaptTo()</code> is used) or an appropriate exception is thrown (if <code>ModelFactory.createModel()</code> is used). Validation is only supported on models which are adapted from a <code>Resource</code> and if the Sling Validation Bundle is deployed.</p> <h1 id="custom-injectors">Custom Injectors</h1> <p>To create a custom injector, simply implement the <code>org.apache.sling.models.spi.Injector</code> interface and register your implementation with the OSGi service registry. Please refer to the standard injectors in <a href="http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/">Subversion</a> for examples.</p> @@ -678,7 +678,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. 1644388 by kwin on Wed, 10 Dec 2014 13:02:24 +0000 + Rev. 1644472 by kwin on Wed, 10 Dec 2014 16:44:21 +0000 </div> <div class="trademarkFooter"> Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project