Merge branch 'SLING-7015'
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1802505 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/models/factory/ModelFactory.java b/src/main/java/org/apache/sling/models/factory/ModelFactory.java
index e061796..78f5bfa 100644
--- a/src/main/java/org/apache/sling/models/factory/ModelFactory.java
+++ b/src/main/java/org/apache/sling/models/factory/ModelFactory.java
@@ -186,4 +186,16 @@
InvalidAdaptableException, ModelClassException, PostConstructException, ValidationException, InvalidModelException,
ExportException, MissingExporterException;
+
+ /**
+ * Create a wrapped request object with the specified resource and (try to) adapt the request object into the specified class. The wrapped request
+ * object will have a fresh set of script bindings so that any injected bindings references have the correct context.
+ *
+ * @param request the current request
+ * @param resource the resource to set as the wrapped request's resource
+ * @param targetClass the target adapter class
+ * @param <T> the target adapter class
+ * @return an instance of the target class or null if the adaptation could not be done
+ */
+ public <T> T getModelFromWrappedRequest(@Nonnull SlingHttpServletRequest request, @Nonnull Resource resource, @Nonnull Class<T> targetClass);
}
diff --git a/src/main/java/org/apache/sling/models/factory/package-info.java b/src/main/java/org/apache/sling/models/factory/package-info.java
index 2adb00f..4467149 100644
--- a/src/main/java/org/apache/sling/models/factory/package-info.java
+++ b/src/main/java/org/apache/sling/models/factory/package-info.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@Version("1.3.1")
+@Version("1.4.0")
package org.apache.sling.models.factory;
import aQute.bnd.annotation.Version;
\ No newline at end of file