geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r463286 - in /geronimo/xbean/sandbox/xbean-factory/src: main/java/org/apache/xbean/factory/model/ main/java/org/apache/xbean/factory/model/factory/ test/java/org/apache/xbean/factory/
Date Thu, 12 Oct 2006 15:43:50 GMT
Author: chirino
Date: Thu Oct 12 08:43:48 2006
New Revision: 463286

URL: http://svn.apache.org/viewvc?view=rev&rev=463286
Log:
trying to get inheritence support in

Modified:
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/Column.java
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/DataType.java
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomColumnFactory.java
    geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomDataTypeFactory.java
    geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
Thu Oct 12 08:43:48 2006
@@ -25,6 +25,23 @@
 
     public ArrayDataType() {
     }
+    
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        final ArrayDataType that = (ArrayDataType) o;
+
+        if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null)
return false;
+        if (dimensions!= that.dimensions ) return false;
+
+        return true;
+    }
+
+    public int hashCode() {
+        return super.hashCode(); 
+    }
+
 
 	public int getDimensions() {
 		return dimensions;
@@ -35,7 +52,7 @@
 	}
 
     public String toString() {
-        return "DataType[name: " + getName() +", dimensions"+dimensions+"]";
+        return "ArrayDataType[name: " + getName() +", dimensions"+dimensions+"]";
     }
 
 }

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/Column.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/Column.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/Column.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/Column.java
Thu Oct 12 08:43:48 2006
@@ -55,6 +55,7 @@
         final Column column = (Column) o;
 
         if (dataType != null ? !dataType.equals(column.dataType) : column.dataType != null)
return false;
+        if (secondDataType != null ? !secondDataType.equals(column.secondDataType) : column.secondDataType
!= null) return false;
         if (name != null ? !name.equals(column.name) : column.name != null) return false;
 
         return true;
@@ -64,6 +65,7 @@
         int result;
         result = (name != null ? name.hashCode() : 0);
         result = 29 * result + (dataType != null ? dataType.hashCode() : 0);
+        result = 29 * result + (secondDataType != null ? secondDataType.hashCode() : 0);
         return result;
     }
 

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/DataType.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/DataType.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/DataType.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/DataType.java
Thu Oct 12 08:43:48 2006
@@ -42,7 +42,7 @@
     }
 
     public int hashCode() {
-        return super.hashCode();    // TODO
+        return super.hashCode(); 
     }
 
     public String getName() {

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
Thu Oct 12 08:43:48 2006
@@ -19,6 +19,7 @@
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
 
 import org.apache.xbean.factory.FactoryBeanSupport;
 import org.apache.xbean.factory.model.ArrayDataType;
@@ -26,17 +27,18 @@
 /**
  * @version $Revision: $
  */
-@XmlRootElement(name = "arrayDataType")
-public class CustomArrayDataTypeFactory extends FactoryBeanSupport<ArrayDataType> {
-    private String name;
+@XmlRootElement(name="bar")
+//@XmlType(name="bar")
+public class CustomArrayDataTypeFactory extends CustomDataTypeFactory {
+	
 	private int dimensions;
 
     public CustomArrayDataTypeFactory() {
     }
 
     public CustomArrayDataTypeFactory(ArrayDataType value) {
-        name = value.getName();
-        dimensions = value.getDimensions();
+        setName(value.getName());
+        setDimensions(value.getDimensions());
     }
     
 	@XmlTransient
@@ -49,25 +51,15 @@
 	@Override
     public ArrayDataType getObject() {
 		ArrayDataType datatype = new ArrayDataType();
-        datatype.setName(name);
-        datatype.setDimensions(dimensions);
+        datatype.setName(getName());
+        datatype.setDimensions(getDimensions());
         return datatype;
     }
 
     @XmlAttribute
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @XmlAttribute
 	public int getDimensions() {
 		return dimensions;
 	}
-
 	public void setDimensions(int dimensions) {
 		this.dimensions = dimensions;
 	}

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomColumnFactory.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomColumnFactory.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomColumnFactory.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomColumnFactory.java
Thu Oct 12 08:43:48 2006
@@ -18,6 +18,8 @@
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlElementRefs;
 import javax.xml.bind.annotation.XmlIDREF;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
@@ -69,7 +71,9 @@
         return dataType;
     }
 
-    @XmlElement(required = false)
+//    @XmlElement(required = false)
+//    @XmlElement
+    @XmlElementRef
     public void setDataType(CustomDataTypeFactory dataType) {
         this.dataType = dataType;
     }
@@ -83,7 +87,7 @@
     }
 
     @XmlElement
-	public CustomDataTypeFactory getSecondDataType() {
+    public CustomDataTypeFactory getSecondDataType() {
 		return secondDataType;
 	}
 

Modified: geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomDataTypeFactory.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomDataTypeFactory.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomDataTypeFactory.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomDataTypeFactory.java
Thu Oct 12 08:43:48 2006
@@ -19,6 +19,7 @@
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
 
 import org.apache.xbean.factory.FactoryBeanSupport;
 import org.apache.xbean.factory.model.DataType;
@@ -26,8 +27,9 @@
 /**
  * @version $Revision: $
  */
-@XmlRootElement(name = "dataType")
-public class CustomDataTypeFactory extends FactoryBeanSupport<DataType> {
+@XmlRootElement(name = "bar")
+//@XmlType(name="bar")
+public class CustomDataTypeFactory extends FactoryBeanSupport {
     private String name;
 
     public CustomDataTypeFactory() {

Modified: geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java?view=diff&rev=463286&r1=463285&r2=463286
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java
Thu Oct 12 08:43:48 2006
@@ -59,13 +59,16 @@
     protected Column createColumn() {
         Column column = new Column();
         column.setName("cheeseColumn");
+        
         DataType dataType = new DataType();
         dataType.setName("String");
         column.setDataType(dataType);
-        ArrayDataType secondDataType = new ArrayDataType();
-        secondDataType.setName("Integer");
-        secondDataType.setDimensions(50);
-        column.setSecondDataType(secondDataType);
+        
+//        ArrayDataType secondDataType = new ArrayDataType();
+//        secondDataType.setName("Integer");
+//        secondDataType.setDimensions(50);
+//        column.setSecondDataType(secondDataType);
+        
         return column;
     }
 



Mime
View raw message