SLING-6748 - move ValuePreparer to API
authorJustin Edelson <justin@apache.org>
Wed, 29 Mar 2017 22:43:15 +0000 (22:43 +0000)
committerJustin Edelson <justin@apache.org>
Wed, 29 Mar 2017 22:43:15 +0000 (22:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1789419 13f79535-47bb-0310-9956-ffa450edef68

pom.xml
src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java
src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java
src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java [deleted file]

diff --git a/pom.xml b/pom.xml
index 7e30f37..a059ea1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <dependency>\r
             <groupId>org.apache.sling</groupId>\r
             <artifactId>org.apache.sling.models.api</artifactId>\r
-            <version>1.3.2</version>\r
+            <version>1.3.3-SNAPSHOT</version>\r
             <scope>provided</scope>\r
         </dependency>\r
         <dependency>\r
index a31e02f..9f440b6 100644 (file)
@@ -73,7 +73,6 @@ import org.apache.sling.models.factory.ModelClassException;
 import org.apache.sling.models.factory.ModelFactory;
 import org.apache.sling.models.factory.PostConstructException;
 import org.apache.sling.models.factory.ValidationException;
-import org.apache.sling.models.impl.injectors.ValuePreparer;
 import org.apache.sling.models.impl.model.ConstructorParameter;
 import org.apache.sling.models.impl.model.InjectableElement;
 import org.apache.sling.models.impl.model.InjectableField;
@@ -86,6 +85,7 @@ import org.apache.sling.models.spi.DisposalCallbackRegistry;
 import org.apache.sling.models.spi.ImplementationPicker;
 import org.apache.sling.models.spi.Injector;
 import org.apache.sling.models.spi.ModelValidation;
+import org.apache.sling.models.spi.ValuePreparer;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2;
index 0f98d35..7170766 100644 (file)
@@ -31,6 +31,7 @@ import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
 import org.apache.sling.models.annotations.injectorspecific.ScriptVariable;
 import org.apache.sling.models.spi.DisposalCallbackRegistry;
 import org.apache.sling.models.spi.Injector;
+import org.apache.sling.models.spi.ValuePreparer;
 import org.apache.sling.models.spi.injectorspecific.AbstractInjectAnnotationProcessor2;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor2;
 import org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory;
index 190dcff..ed9053f 100644 (file)
@@ -38,6 +38,7 @@ import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
 import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
 import org.apache.sling.models.spi.DisposalCallbackRegistry;
 import org.apache.sling.models.spi.Injector;
+import org.apache.sling.models.spi.ValuePreparer;
 import org.apache.sling.models.spi.injectorspecific.AbstractInjectAnnotationProcessor2;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor;
 import org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory;
diff --git a/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java b/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java
deleted file mode 100644 (file)
index c1bfe1d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.models.impl.injectors;
-
-import javax.annotation.Nonnull;
-
-/**
- * Optimization interface for Injectors which wish to avoid repeated accessing of some object
- * based on the adaptable. If an Injector implements this interface, it must also be prepared
- * to handle the case where ObjectUtils.NULL is passed as the adaptable.
- */
-public interface ValuePreparer {
-
-    /**
-     * Prepare a value from the adaptable.
-     *
-     * @param adaptable the adaptable
-     * @return a prepared value or ObjectUtils.NULL if a value is not preparable
-     */
-    @Nonnull Object prepareValue(@Nonnull Object adaptable);
-}