This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.models.api-1.2.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit 964c994f46eb32c2a7535d2d646f69f36306b5ae Author: Stefan Seifert <[email protected]> AuthorDate: Wed Oct 22 20:20:55 2014 +0000 SLING-4056 ModelFactory.canCreateFromAdaptable reports false errors when using "adapters" on models (patch suppplied by Konrad Windszus) git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1633709 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/sling/models/factory/ModelFactory.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 dafb2ac..3d34e8f 100644 --- a/src/main/java/org/apache/sling/models/factory/ModelFactory.java +++ b/src/main/java/org/apache/sling/models/factory/ModelFactory.java @@ -25,7 +25,7 @@ package org.apache.sling.models.factory; */ public interface ModelFactory { /** - * Instantiates the given Sling Model class from the given adaptable + * Instantiates the given Sling Model class from the given adaptable. * @param adaptable the adaptable to use to instantiate the Sling Model Class * @param type the class to instantiate * @return a new instance for the required model (never null) @@ -38,19 +38,20 @@ public interface ModelFactory { /** * - * @param modelClass the class to check * @param adaptable the adaptable to check - * @return false in case the given class can not be adapted from the given adaptable - * @throws InvalidModelException in case the given class does not have a model annotation + * @param type the class to check + * @return false in case the given class can not be created from the given adaptable + * @throws InvalidModelException in case no class with the Model annotation adapts to the requested type */ - public boolean canCreateFromAdaptable(Object adaptable, Class<?> modelClass) throws InvalidModelException; + public boolean canCreateFromAdaptable(Object adaptable, Class<?> type) throws InvalidModelException; /** * - * @param modelClass the class to check - * @return false in case the given class has no model annotation + * @param adaptable the adaptable to check + * @param type the class to check + * @return false in case no class with the Model annotation adapts to the requested type * * @see org.apache.sling.models.annotations.Model */ - public boolean isModelClass(Class<?> modelClass); + public boolean isModelClass(Object adaptable, Class<?> type); } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
