felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1779604 - in /felix/trunk/converter/converter/src/main/java/org: apache/felix/converter/impl/ osgi/util/converter/
Date Fri, 20 Jan 2017 11:10:09 GMT
Author: davidb
Date: Fri Jan 20 11:10:09 2017
New Revision: 1779604

URL: http://svn.apache.org/viewvc?rev=1779604&view=rev
Log:
Felix converter - update to the latest API with sourceAsDTO() and targetAsDTO()

Modified:
    felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
    felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConversionException.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConvertFunction.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converter.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConverterBuilder.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converting.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Rule.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/TypeReference.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/package-info.java

Modified: felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
Fri Jan 20 11:10:09 2017
@@ -128,15 +128,27 @@ public class AdapterImpl implements Inte
         }
 
         @Override
+        public Converting sourceAs(Class<?> type) {
+            treatAsClass = type;
+            del.sourceAs(type);
+            return this;
+        }
+
+        @Override
         public Converting sourceAsBean() {
             del.sourceAsBean();
             return this;
         }
 
         @Override
-        public Converting sourceAs(Class<?> type) {
-            treatAsClass = type;
-            del.sourceAs(type);
+        public Converting sourceAsDTO() {
+            del.sourceAsDTO();
+            return this;
+        }
+
+        @Override
+        public Converting targetAs(Class<?> cls) {
+            del.targetAs(cls);
             return this;
         }
 
@@ -147,8 +159,8 @@ public class AdapterImpl implements Inte
         }
 
         @Override
-        public Converting targetAs(Class<?> cls) {
-            del.targetAs(cls);
+        public Converting targetAsDTO() {
+            del.targetAsDTO();
             return this;
         }
 

Modified: felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/ConvertingImpl.java
Fri Jan 20 11:10:09 2017
@@ -77,14 +77,26 @@ public class ConvertingImpl implements C
     }
 
     @Override
+    public Converting sourceAs(Class<?> cls) {
+        sourceAsClass = cls;
+        return this;
+    }
+
+    @Override
     public Converting sourceAsBean() {
         sourceAsJavaBean = true;
         return this;
     }
 
     @Override
-    public Converting sourceAs(Class<?> cls) {
-        sourceAsClass = cls;
+    public Converting sourceAsDTO() {
+        // TODO Implement
+        return this;
+    }
+
+    @Override
+    public Converting targetAs(Class<?> cls) {
+        targetAsClass = cls;
         return this;
     }
 
@@ -95,8 +107,8 @@ public class ConvertingImpl implements C
     }
 
     @Override
-    public Converting targetAs(Class<?> cls) {
-        targetAsClass = cls;
+    public Converting targetAsDTO() {
+        // TODO Implement
         return this;
     }
 

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConversionException.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConversionException.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConversionException.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConversionException.java
Fri Jan 20 11:10:09 2017
@@ -21,24 +21,24 @@ package org.osgi.util.converter;
  * be converted into a Long.
  */
 public class ConversionException extends RuntimeException {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * Create a Conversion Exception with a message.
-	 *
-	 * @param message The message for this exception.
-	 */
-	public ConversionException(String message) {
-		super(message);
-	}
+    /**
+     * Create a Conversion Exception with a message.
+     *
+     * @param message The message for this exception.
+     */
+    public ConversionException(String message) {
+        super(message);
+    }
 
-	/**
-	 * Create a Conversion Exception with a message and a nested cause.
-	 *
-	 * @param message The message for this exception.
-	 * @param cause The causing exception.
-	 */
-	public ConversionException(String message, Throwable cause) {
-		super(message, cause);
-	}
+    /**
+     * Create a Conversion Exception with a message and a nested cause.
+     *
+     * @param message The message for this exception.
+     * @param cause The causing exception.
+     */
+    public ConversionException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConvertFunction.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConvertFunction.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConvertFunction.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConvertFunction.java
Fri Jan 20 11:10:09 2017
@@ -25,9 +25,9 @@ import org.osgi.annotation.versioning.Co
  *
  * @param <F> Type parameter for the source object.
  * @param <T> Type parameter for the converted object.
- * @author $Id$
+ * @author $Id: 9b7286ef322653fb4900a20e3b5cff2dd358249f $
  */
-@ConsumerType @Deprecated
+@ConsumerType
 @FunctionalInterface
 public interface ConvertFunction<F, T> {
 	/**

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converter.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converter.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converter.java (original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converter.java Fri
Jan 20 11:10:09 2017
@@ -22,10 +22,10 @@ import org.osgi.annotation.versioning.Pr
  * from the service registry. The conversion is then completed via the
  * Converting interface that has methods to specify the target type.
  *
- * @author $Id$
+ * @author $Id: 9b4f95a44c40d64e9ad3653fcf7be03d63713a83 $
  * @ThreadSafe
  */
-@ProviderType @Deprecated
+@ProviderType
 public interface Converter {
 	/**
 	 * Start a conversion for the given object.

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConverterBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConverterBuilder.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConverterBuilder.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/ConverterBuilder.java
Fri Jan 20 11:10:09 2017
@@ -25,9 +25,9 @@ import org.osgi.util.function.Function;
  * existing converter. The modified behaviour is specified by providing rules
  * and/or conversion functions.
  *
- * @author $Id$
+ * @author $Id: 802ba8cc0fdbfbffc871e3232b822f43338eaaf0 $
  */
-@ProviderType @Deprecated
+@ProviderType
 public interface ConverterBuilder {
 	/**
 	 * Build the specified converter. Each time this method is called a new

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converting.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converting.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converting.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Converting.java
Fri Jan 20 11:10:09 2017
@@ -24,10 +24,10 @@ import org.osgi.annotation.versioning.Pr
  * converted to. A {@link Converting} instance can be obtained via the
  * {@link Converter} service by starting a conversion for a specific object.
  *
- * @author $Id$
+ * @author $Id: a7899e684989607923175b298051eeda2ced5aef $
  * @NotThreadSafe
  */
-@ProviderType @Deprecated
+@ProviderType
 public interface Converting {
 	/**
 	 * Always return a fully populated copy of the object, however if the object
@@ -71,6 +71,15 @@ public interface Converting {
 	Converting sourceAsBean();
 
 	/**
+	 * Treat the source object as a DTO even if the source object has methods or
+	 * is otherwise not recognised as a DTO.
+	 *
+	 * @return The current {@code Converting} object so that additional calls
+	 *         can be chained.
+	 */
+	Converting sourceAsDTO();
+
+	/**
 	 * Treat the target object as the specified class. This can be used to
 	 * disambiguate a type if it implements multiple interfaces or extends
 	 * multiple classes.
@@ -91,6 +100,15 @@ public interface Converting {
 	Converting targetAsBean();
 
 	/**
+	 * Treat the target object as a DTO even if it has methods or is otherwise
+	 * not recognized as a DTO.
+	 *
+	 * @return The current {@code Converting} object so that additional calls
+	 *         can be chained.
+	 */
+	Converting targetAsDTO();
+
+	/**
 	 * Specify the target object type for the conversion as a class object.
 	 *
 	 * @param cls The class to convert to.

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Rule.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Rule.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Rule.java (original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/Rule.java Fri Jan
20 11:10:09 2017
@@ -23,10 +23,9 @@ import java.lang.reflect.Type;
  *
  * @param <F> The type to convert from.
  * @param <T> The type to convert to.
- * @author $Id: 7f624253be48fc23d8a793b38673305dbfd5ff9a $
+ * @author $Id: c69b80657368cdf11837286f1fa439bf90b5c6e7 $
  * @Immutable
  */
-@Deprecated
 public class Rule<F, T> {
 	private final Type				sourceType;
 	private final Type				targetType;

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/TypeReference.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/TypeReference.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/TypeReference.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/TypeReference.java
Fri Jan 20 11:10:09 2017
@@ -34,10 +34,10 @@ import org.osgi.annotation.versioning.Co
  * </pre>
  *
  * @param <T> The target type for the conversion.
- * @author $Id$
+ * @author $Id: 1ea7d4297e6ed805ce147d32614f23bb9145b24c $
  * @Immutable
  */
-@ConsumerType @Deprecated
+@ConsumerType
 public class TypeReference<T> {
 	/**
 	 * A {@link TypeReference} cannot be directly instantiated. To use it, it

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/package-info.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/package-info.java?rev=1779604&r1=1779603&r2=1779604&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/package-info.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/package-info.java
Fri Jan 20 11:10:09 2017
@@ -30,7 +30,7 @@
  * <p>
  * {@code  Import-Package: org.osgi.converter; version="[1.0,1.1)"}
  *
- * @author $Id: 1b82a2a1db1431c5e4398f368662b5b6fb5f8547 $
+ * @author $Id: 9ec70b9dd691e49a0b433d1401cbba70d581ef1a $
  */
 @Version("1.0")
 package org.osgi.util.converter;



Mime
View raw message