geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r462821 - in /geronimo/xbean/sandbox: xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java
Date Wed, 11 Oct 2006 14:57:20 GMT
Author: jstrachan
Date: Wed Oct 11 07:57:17 2006
New Revision: 462821

URL: http://svn.apache.org/viewvc?view=rev&rev=462821
Log:
added support for singleton and id attributes

Modified:
    geronimo/xbean/sandbox/xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java
    geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java

Modified: geronimo/xbean/sandbox/xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java?view=diff&rev=462821&r1=462820&r2=462821
==============================================================================
--- geronimo/xbean/sandbox/xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java
(original)
+++ geronimo/xbean/sandbox/xbean-apt/src/main/java/org/apache/xbean/factory/FactoryBeanSupport.java
Wed Oct 11 07:57:17 2006
@@ -23,6 +23,8 @@
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.reflect.ParameterizedType;
@@ -35,6 +37,7 @@
  */
 public abstract class FactoryBeanSupport<T> implements FactoryBean {
 
+    private String id;
     private Class objectType;
     private boolean singleton;
 
@@ -49,13 +52,23 @@
         return objectType;
     }
 
-    @XmlTransient
+    @XmlAttribute(namespace = "http://www.springframework/beans/TODO")
     public boolean isSingleton() {
         return singleton;
     }
 
     public void setSingleton(boolean singleton) {
         this.singleton = singleton;
+    }
+
+    @XmlID
+    @XmlAttribute(namespace = "http://www.springframework/beans/TODO")
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
     }
 
     @XmlTransient

Modified: geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java?view=diff&rev=462821&r1=462820&r2=462821
==============================================================================
--- geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java
(original)
+++ geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/JaxbTest.java
Wed Oct 11 07:57:17 2006
@@ -36,6 +36,7 @@
         
         User user = super.loadUser();
         CustomUserFactory factory = new CustomUserFactory();
+        factory.setId("cheese");
         factory.write(new FileOutputStream(file), user);
 
         // in case there's caching, lets make another



Mime
View raw message