geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r462876 - in /geronimo/xbean/sandbox/xbean-factory: ./ src/main/java/org/apache/xbean/factory/model/ src/main/java/org/apache/xbean/factory/model/factory/ src/test/java/org/apache/xbean/factory/
Date Wed, 11 Oct 2006 17:47:05 GMT
Author: chirino
Date: Wed Oct 11 10:47:04 2006
New Revision: 462876

URL: http://svn.apache.org/viewvc?view=rev&rev=462876
Log:
Add a second data type to the column and also start on having a ArrayDataType that inherits
from DataType.

Added:
    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/factory/CustomArrayDataTypeFactory.java
Modified:
    geronimo/xbean/sandbox/xbean-factory/   (props changed)
    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/factory/CustomColumnFactory.java
    geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbColumnTest.java

Propchange: geronimo/xbean/sandbox/xbean-factory/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Oct 11 10:47:04 2006
@@ -0,0 +1,5 @@
+
+target
+.classpath
+.project
+.settings

Added: 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=auto&rev=462876
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
(added)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/ArrayDataType.java
Wed Oct 11 10:47:04 2006
@@ -0,0 +1,37 @@
+/*
+ * 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.xbean.factory.model;
+
+/**
+ * @version $Revision: $
+ */
+public class ArrayDataType extends DataType {
+	
+    private int dimensions;
+
+    public ArrayDataType() {
+    }
+
+	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/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=462876&r1=462875&r2=462876
==============================================================================
--- 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
Wed Oct 11 10:47:04 2006
@@ -22,6 +22,7 @@
 public class Column {
     private String name;
     private DataType dataType;
+    private DataType secondDataType;
 
     public Column() {
     }
@@ -69,4 +70,12 @@
     public String toString() {
         return "Column[name: " + name + ", dataType: " + dataType + "]";
     }
+
+	public DataType getSecondDataType() {
+		return secondDataType;
+	}
+
+	public void setSecondDataType(DataType secondDataType) {
+		this.secondDataType = secondDataType;
+	}
 }

Added: 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=auto&rev=462876
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
(added)
+++ geronimo/xbean/sandbox/xbean-factory/src/main/java/org/apache/xbean/factory/model/factory/CustomArrayDataTypeFactory.java
Wed Oct 11 10:47:04 2006
@@ -0,0 +1,53 @@
+/*
+ * 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.xbean.factory.model.factory;
+
+import org.apache.xbean.factory.FactoryBeanSupport;
+import org.apache.xbean.factory.model.DataType;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * @version $Revision: $
+ */
+@XmlRootElement(name = "dataType")
+public class CustomArrayDataTypeFactory extends FactoryBeanSupport<DataType> {
+    private String name;
+
+    public CustomArrayDataTypeFactory() {
+    }
+
+    public CustomArrayDataTypeFactory(DataType value) {
+        name = value.getName();
+    }
+    
+    public DataType getObject() {
+        DataType datatype = new DataType();
+        datatype.setName(name);
+        return datatype;
+    }
+
+    @XmlAttribute
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

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=462876&r1=462875&r2=462876
==============================================================================
--- 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
Wed Oct 11 10:47:04 2006
@@ -30,6 +30,7 @@
 @XmlRootElement(name = "column")
 public class CustomColumnFactory extends FactoryBeanSupport<Column> {
     private CustomDataTypeFactory dataType;
+    private CustomDataTypeFactory secondDataType;
     private String name;
     private CustomDataTypeFactory dataTypeRef;
 
@@ -37,7 +38,8 @@
     }
 
     public CustomColumnFactory(Column value) {
-        dataType = new CustomDataTypeFactory(value.getDataType());
+    	dataType = value.getDataType()!=null ? new CustomDataTypeFactory(value.getDataType())
: null;
+    	secondDataType = value.getSecondDataType() != null ? new CustomDataTypeFactory(value.getSecondDataType())
: null;        
         name = value.getName();
     }
 
@@ -70,6 +72,15 @@
     public void setName(String name) {
         this.name = name;
     }
+
+	public CustomDataTypeFactory getSecondDataType() {
+		return secondDataType;
+	}
+
+	public void setSecondDataType(CustomDataTypeFactory secondDataType) {
+		this.secondDataType = secondDataType;
+	}
+
 
     @XmlAttribute(required = false)
     @XmlIDREF

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=462876&r1=462875&r2=462876
==============================================================================
--- 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
Wed Oct 11 10:47:04 2006
@@ -60,6 +60,9 @@
         DataType dataType = new DataType();
         dataType.setName("String");
         column.setDataType(dataType);
+        DataType secondDataType = new DataType();
+        secondDataType.setName("Integer");
+        column.setSecondDataType(secondDataType);
         return column;
     }
 



Mime
View raw message