You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2006/12/18 10:33:57 UTC

svn commit: r488176 - in /incubator/tuscany/java/sca/kernel: core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java

Author: jmarino
Date: Mon Dec 18 01:33:55 2006
New Revision: 488176

URL: http://svn.apache.org/viewvc?view=rev&rev=488176
Log:
fix checkstyle and missing version tags

Modified:
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java?view=diff&rev=488176&r1=488175&r2=488176
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java Mon Dec 18 01:33:55 2006
@@ -30,19 +30,21 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
-import org.apache.tuscany.api.annotation.DataContext;
-import org.apache.tuscany.api.annotation.DataType;
 import org.apache.tuscany.spi.idl.InvalidServiceContractException;
 import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorExtension;
 import org.apache.tuscany.spi.idl.java.JavaServiceContract;
 import org.apache.tuscany.spi.model.Operation;
 
+import org.apache.tuscany.api.annotation.DataContext;
+import org.apache.tuscany.api.annotation.DataType;
+
 /**
  * The databinding annotation processor for java interfaces
+ *
+ * @version $Rev$ $Date$
  */
 public class DataBindingJavaInterfaceProcessor extends JavaInterfaceProcessorExtension {
 
@@ -50,8 +52,8 @@
 
     private static final Class[] SIMPLE_JAVA_TYPES =
         {Byte.class, Character.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Date.class,
-         Calendar.class, GregorianCalendar.class, Duration.class, XMLGregorianCalendar.class, BigInteger.class,
-         BigDecimal.class};
+        Calendar.class, GregorianCalendar.class, Duration.class, XMLGregorianCalendar.class, BigInteger.class,
+        BigDecimal.class};
 
     private static final Set<Class> SIMPLE_TYPE_SET = new HashSet<Class>(Arrays.asList(SIMPLE_JAVA_TYPES));
 
@@ -108,7 +110,7 @@
         if (!(type instanceof Class)) {
             return;
         }
-        Class cls = (Class)dataType.getPhysical();
+        Class cls = (Class) dataType.getPhysical();
         if (cls.isPrimitive() || SIMPLE_TYPE_SET.contains(cls)) {
             dataType.setDataBinding(SIMPLE_JAVA_OBJECTS);
         } else if (cls == String.class && (dataBinding == null || !dataBinding.equals(String.class.getName()))) {

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java?view=diff&rev=488176&r1=488175&r2=488176
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java Mon Dec 18 01:33:55 2006
@@ -28,17 +28,20 @@
 import java.io.OutputStream;
 import java.io.Serializable;
 
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.databinding.DataBinding;
 import org.apache.tuscany.spi.databinding.DataBindingRegistry;
 import org.apache.tuscany.spi.databinding.WrapperHandler;
 import org.apache.tuscany.spi.model.DataType;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
 
 /**
  * Base Implementation of DataBinding
+ *
+ * @version $Rev$ $Date$
  */
 @Scope("MODULE")
 @Service(DataBinding.class)
@@ -51,11 +54,9 @@
     protected String name;
 
     /**
-     * Create a databinding with the base java type whose name will be used as
-     * the name of the databinding
-     * 
-     * @param baseType The base java class or interface representing the
-     *            databinding, for example, org.w3c.dom.Node
+     * Create a databinding with the base java type whose name will be used as the name of the databinding
+     *
+     * @param baseType The base java class or interface representing the databinding, for example, org.w3c.dom.Node
      */
     protected DataBindingExtension(Class<?> baseType) {
         this(baseType.getName(), baseType);
@@ -63,10 +64,9 @@
 
     /**
      * Create a databinding with the name and base java type
-     * 
-     * @param name The name of the databinding
-     * @param baseType The base java class or interface representing the
-     *            databinding, for example, org.w3c.dom.Node
+     *
+     * @param name     The name of the databinding
+     * @param baseType The base java class or interface representing the databinding, for example, org.w3c.dom.Node
      */
     protected DataBindingExtension(String name, Class<?> baseType) {
         this.name = name;
@@ -119,8 +119,8 @@
         }
         final Class clazz = arg.getClass();
         if (String.class == clazz || clazz.isPrimitive() || Number.class.isAssignableFrom(clazz)
-                || Boolean.class.isAssignableFrom(clazz) || Character.class.isAssignableFrom(clazz)
-                || Byte.class.isAssignableFrom(clazz)) {
+            || Boolean.class.isAssignableFrom(clazz) || Character.class.isAssignableFrom(clazz)
+            || Byte.class.isAssignableFrom(clazz)) {
             // Immutable classes
             return arg;
         }
@@ -141,11 +141,11 @@
             } else {
                 //return arg;
                 throw new IllegalArgumentException(
-                        "Pass-by-value is not supported for the given object");
+                    "Pass-by-value is not supported for the given object");
             }
         } catch (Exception e) {
             throw new IllegalArgumentException(
-                    "Pass-by-value is not supported for the given object", e);
+                "Pass-by-value is not supported for the given object", e);
         }
     }
 
@@ -154,11 +154,10 @@
     }
 
     protected ObjectInputStream getObjectInputStream(InputStream is, final ClassLoader cl)
-            throws IOException {
+        throws IOException {
         ObjectInputStream ois = new ObjectInputStream(is) {
             @Override
-            protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException,
-                    ClassNotFoundException {
+            protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
                 try {
                     return Class.forName(desc.getName(), false, cl);
                 } catch (ClassNotFoundException e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org