[jboss-svn-commits] JBL Code SVN: r15088 - in labs/jbossesb/trunk/product/extras/jaxbintros: lib and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Sep 13 09:55:30 EDT 2007


Author: tfennelly
Date: 2007-09-13 09:55:30 -0400 (Thu, 13 Sep 2007)
New Revision: 15088

Added:
   labs/jbossesb/trunk/product/extras/jaxbintros/lib/commons-logging-1.0.4.jar
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAccessorTypeIntro.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlRootElementIntro.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAccessorTypeHandler.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlRootElementHandler.java
Modified:
   labs/jbossesb/trunk/product/extras/jaxbintros/jaxb-bindings.xjb
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/IntroductionsAnnotationReader.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassIntroConfig.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassMemberIntroConfig.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/FieldIntroConfig.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/JaxbIntros.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/MethodIntroConfig.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ObjectFactory.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAttributeIntro.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlElementIntro.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlTypeIntro.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/package-info.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAttributeHandler.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlElementHandler.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlTypeHandler.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/wsf/spi/deployment/JAXBIntrosCustomizationsDeployer.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/main/resources/jaxb-intros.xsd
   labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/IntroductionsAnnotationReaderUnitTest.java
   labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/intro-config-03.xml
   labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/order-message.xml
   labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/testbeans/Address.java
Log:
JAXB-Intros @XmlAttribute annotation handling issue: http://jira.jboss.com/jira/browse/JBESB-815

Patch (contributed by Chris McClelland) added + additional tests.  Also includes support for 2 more annotations.

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/jaxb-bindings.xjb
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/jaxb-bindings.xjb	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/jaxb-bindings.xjb	2007-09-13 13:55:30 UTC (rev 15088)
@@ -28,6 +28,14 @@
             </jxb:class>
         </jxb:bindings>
 
+        <jxb:bindings node="//xs:complexType[@name='XmlAccessorType']">
+            <jxb:class name="XmlAccessorTypeIntro"/>
+        </jxb:bindings>
+
+        <jxb:bindings node="//xs:complexType[@name='XmlRootElement']">
+            <jxb:class name="XmlRootElementIntro"/>
+        </jxb:bindings>
+
         <jxb:bindings node="//xs:complexType[@name='XmlElement']">
             <jxb:class name="XmlElementIntro">
             </jxb:class>

Added: labs/jbossesb/trunk/product/extras/jaxbintros/lib/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/extras/jaxbintros/lib/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/IntroductionsAnnotationReader.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/IntroductionsAnnotationReader.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/IntroductionsAnnotationReader.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -31,11 +31,11 @@
 
 import org.jboss.jaxb.intros.configmodel.*;
 import org.jboss.jaxb.intros.handlers.*;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
 
 /**
  * JAXB Annotation Reader for the JAXB RI context interface.
@@ -48,7 +48,7 @@
  */
 public class IntroductionsAnnotationReader extends AbstractInlineAnnotationReaderImpl<Type,Class,Field,Method> implements RuntimeAnnotationReader {
 
-    private static Logger logger = Logger.getLogger(IntroductionsAnnotationReader.class);
+    private static final Log logger = LogFactory.getLog(IntroductionsAnnotationReader.class);
     private RuntimeAnnotationReader baseReader = new RuntimeInlineAnnotationReader();
     private JaxbIntros introductions;
 
@@ -111,29 +111,23 @@
         return baseReader.getMethodParameterAnnotation(annotation, method, paramIndex, srcPos);
     }
 
-    public <A extends Annotation> A getClassAnnotation(Class<A> a, Class clazz, Locatable srcPos) {
-        if(a == XmlType.class) {
-            ClassIntroConfig classIntroConfig = getClassIntroConfig(clazz);
+    public <A extends Annotation> A getClassAnnotation(Class<A> annotation, Class clazz, Locatable srcPos) {
+        Annotation proxy = getProxy(annotation, clazz);
 
-            if(classIntroConfig != null) {
-                XmlTypeIntro intro = classIntroConfig.getXmlType();
-                if(intro != null) {
-                    return (A) XmlTypeHandler.createProxy(intro);
-                }
-            }
+        if(proxy != null) {
+            return (A) proxy;
         }
 
-        return LocatableAnnotation.create(((Class<?>)clazz).getAnnotation(a),srcPos);
+        return LocatableAnnotation.create(((Class<?>)clazz).getAnnotation(annotation),srcPos);
     }
 
     public boolean hasClassAnnotation(Class clazz, Class<? extends Annotation> annotationType) {
-        if(annotationType == XmlType.class) {
-            ClassIntroConfig classIntroConfig = getClassIntroConfig(clazz);
+        ClassIntroConfig classAnnotations = getClassIntroConfig(clazz);
 
-            if(classIntroConfig != null && classIntroConfig.getXmlType() != null) {
-                return true;
-            }
+        if(classAnnotations != null) {
+            return isClassAnnotationIntroAvailable(annotationType, classAnnotations);
         }
+
         return clazz.isAnnotationPresent(annotationType);
     }
 
@@ -176,7 +170,6 @@
 
     private FieldIntroConfig getFieldIntroConfig(Field field) {
         ClassIntroConfig classIntroConfig = getClassIntroConfig(field.getDeclaringClass());
-        FieldIntroConfig globalIntro = null;
 
         if(classIntroConfig != null) {
             String fieldName = field.getName();
@@ -184,18 +177,17 @@
             for(FieldIntroConfig fieldIntro : classIntroConfig.getField()) {
                 if(fieldIntro.getName().equals(fieldName)) {
                     return fieldIntro;
-                } else if(globalIntro == null && isRegexMatch(fieldName, fieldIntro.getName())) {
-                    globalIntro = fieldIntro;
+                } else if(isRegexMatch(fieldName, fieldIntro.getName())) {
+                    return fieldIntro;
                 }
             }
         }
 
-        return globalIntro;
+        return null;
     }
 
     private MethodIntroConfig getMethodIntroConfig(Method method) {
         ClassIntroConfig classIntroConfig = getClassIntroConfig(method.getDeclaringClass());
-        MethodIntroConfig globalIntro = null;
 
         if(classIntroConfig != null) {
             String methodName = method.getName();
@@ -203,13 +195,13 @@
             for(MethodIntroConfig methodIntro : classIntroConfig.getMethod()) {
                 if(methodIntro.getName().equals(methodName)) {
                     return methodIntro;
-                } else if(globalIntro == null && isRegexMatch(methodName, methodIntro.getName())) {
-                    globalIntro = methodIntro;
+                } else if(isRegexMatch(methodName, methodIntro.getName())) {
+                    return methodIntro;
                 }
             }
         }
 
-        return globalIntro;
+        return null;
     }
 
     private static Map<String, Pattern> patternCache = new HashMap<String, Pattern>();
@@ -247,6 +239,29 @@
         return proxy;
     }
 
+    private Annotation getClassAnnotationProxy(Class annotation, ClassIntroConfig classIntroConfig) {
+        Annotation proxy = null;
+
+        if(annotation == javax.xml.bind.annotation.XmlAccessorType.class) {
+            XmlAccessorTypeIntro xmlAccessorTypeIntro = classIntroConfig.getXmlAccessorType();
+            if(xmlAccessorTypeIntro != null) {
+                proxy = XmlAccessorTypeHandler.createProxy(xmlAccessorTypeIntro);
+            }
+        } else if(annotation == javax.xml.bind.annotation.XmlType.class) {
+            XmlTypeIntro xmlTypeIntro = classIntroConfig.getXmlType();
+            if(xmlTypeIntro != null) {
+                proxy = XmlTypeHandler.createProxy(xmlTypeIntro);
+            }
+        } else if(annotation == javax.xml.bind.annotation.XmlRootElement.class) {
+            XmlRootElementIntro xmlRootElementIntro = classIntroConfig.getXmlRootElement();
+            if(xmlRootElementIntro != null) {
+                proxy = XmlRootElementHandler.createProxy(xmlRootElementIntro);
+            }
+        }
+
+        return proxy;
+    }
+
     private boolean isMemberAnnotationIntroAvailable(Class<? extends Annotation> annotation, ClassMemberIntroConfig memberIntroConfig) {
         if(annotation == javax.xml.bind.annotation.XmlAttribute.class) {
             return (memberIntroConfig.getXmlAttribute() != null);
@@ -257,6 +272,18 @@
         return false;
     }
 
+    private boolean isClassAnnotationIntroAvailable(Class<? extends Annotation> annotation, ClassIntroConfig classIntroConfig) {
+        if(annotation == javax.xml.bind.annotation.XmlType.class) {
+            return (classIntroConfig.getXmlType() != null);
+        } else if(annotation == javax.xml.bind.annotation.XmlAccessorType.class) {
+            return (classIntroConfig.getXmlAccessorType() != null);
+        } else if(annotation == javax.xml.bind.annotation.XmlRootElement.class) {
+            return (classIntroConfig.getXmlRootElement() != null);
+        }
+
+        return false;
+    }
+
     private Annotation[] getAllAnnotations(Member member, Locatable srcPos) {
         Annotation[] r = ((AnnotatedElement)member).getAnnotations();
         List<Annotation> annotations = new ArrayList<Annotation>();
@@ -324,4 +351,20 @@
 
         return null;
     }
+
+    private Annotation getProxy(Class annotation, Class clazz) {
+        ClassIntroConfig classIntroConfig = getClassIntroConfig(clazz);
+
+        if(classIntroConfig != null) {
+            Annotation proxy = getClassAnnotationProxy(annotation, classIntroConfig);
+            if(proxy != null) {
+                return proxy;
+            }
+        }
+
+        return null;
+    }
+
+
+    
 }

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassIntroConfig.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassIntroConfig.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassIntroConfig.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 
@@ -28,7 +28,9 @@
  *   &lt;complexContent>
  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       &lt;sequence>
+ *         &lt;element ref="{http://www.jboss.org/xsd/jaxb/intros}XmlAccessorType" minOccurs="0"/>
  *         &lt;element ref="{http://www.jboss.org/xsd/jaxb/intros}XmlType" minOccurs="0"/>
+ *         &lt;element ref="{http://www.jboss.org/xsd/jaxb/intros}XmlRootElement" minOccurs="0"/>
  *         &lt;element ref="{http://www.jboss.org/xsd/jaxb/intros}Field" maxOccurs="unbounded" minOccurs="0"/>
  *         &lt;element ref="{http://www.jboss.org/xsd/jaxb/intros}Method" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
@@ -42,14 +44,20 @@
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "Class", propOrder = {
+    "xmlAccessorType",
     "xmlType",
+    "xmlRootElement",
     "field",
     "method"
 })
 public class ClassIntroConfig {
 
+    @XmlElement(name = "XmlAccessorType")
+    protected XmlAccessorTypeIntro xmlAccessorType;
     @XmlElement(name = "XmlType")
     protected XmlTypeIntro xmlType;
+    @XmlElement(name = "XmlRootElement")
+    protected XmlRootElementIntro xmlRootElement;
     @XmlElement(name = "Field")
     protected List<FieldIntroConfig> field;
     @XmlElement(name = "Method")
@@ -59,6 +67,30 @@
     protected String name;
 
     /**
+     * Gets the value of the xmlAccessorType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XmlAccessorTypeIntro }
+     *     
+     */
+    public XmlAccessorTypeIntro getXmlAccessorType() {
+        return xmlAccessorType;
+    }
+
+    /**
+     * Sets the value of the xmlAccessorType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XmlAccessorTypeIntro }
+     *     
+     */
+    public void setXmlAccessorType(XmlAccessorTypeIntro value) {
+        this.xmlAccessorType = value;
+    }
+
+    /**
      * Gets the value of the xmlType property.
      * 
      * @return
@@ -83,6 +115,30 @@
     }
 
     /**
+     * Gets the value of the xmlRootElement property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XmlRootElementIntro }
+     *     
+     */
+    public XmlRootElementIntro getXmlRootElement() {
+        return xmlRootElement;
+    }
+
+    /**
+     * Sets the value of the xmlRootElement property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XmlRootElementIntro }
+     *     
+     */
+    public void setXmlRootElement(XmlRootElementIntro value) {
+        this.xmlRootElement = value;
+    }
+
+    /**
      * Gets the value of the field property.
      * 
      * <p>

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassMemberIntroConfig.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassMemberIntroConfig.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ClassMemberIntroConfig.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/FieldIntroConfig.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/FieldIntroConfig.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/FieldIntroConfig.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/JaxbIntros.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/JaxbIntros.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/JaxbIntros.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/MethodIntroConfig.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/MethodIntroConfig.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/MethodIntroConfig.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ObjectFactory.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ObjectFactory.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/ObjectFactory.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 
@@ -32,11 +32,13 @@
 public class ObjectFactory {
 
     private final static QName _XmlElement_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "XmlElement");
+    private final static QName _XmlRootElement_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "XmlRootElement");
     private final static QName _Class_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "Class");
     private final static QName _XmlType_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "XmlType");
     private final static QName _XmlAttribute_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "XmlAttribute");
     private final static QName _Method_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "Method");
     private final static QName _Field_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "Field");
+    private final static QName _XmlAccessorType_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "XmlAccessorType");
     private final static QName _ClassMemberIntroConfig_QNAME = new QName("http://www.jboss.org/xsd/jaxb/intros", "class-member-intro-config");
 
     /**
@@ -47,6 +49,22 @@
     }
 
     /**
+     * Create an instance of {@link ClassIntroConfig }
+     * 
+     */
+    public ClassIntroConfig createClassIntroConfig() {
+        return new ClassIntroConfig();
+    }
+
+    /**
+     * Create an instance of {@link FieldIntroConfig }
+     * 
+     */
+    public FieldIntroConfig createFieldIntroConfig() {
+        return new FieldIntroConfig();
+    }
+
+    /**
      * Create an instance of {@link XmlAttributeIntro }
      * 
      */
@@ -55,27 +73,27 @@
     }
 
     /**
-     * Create an instance of {@link ClassMemberIntroConfig }
+     * Create an instance of {@link JaxbIntros }
      * 
      */
-    public ClassMemberIntroConfig createClassMemberIntroConfig() {
-        return new ClassMemberIntroConfig();
+    public JaxbIntros createJaxbIntros() {
+        return new JaxbIntros();
     }
 
     /**
-     * Create an instance of {@link FieldIntroConfig }
+     * Create an instance of {@link XmlRootElementIntro }
      * 
      */
-    public FieldIntroConfig createFieldIntroConfig() {
-        return new FieldIntroConfig();
+    public XmlRootElementIntro createXmlRootElementIntro() {
+        return new XmlRootElementIntro();
     }
 
     /**
-     * Create an instance of {@link XmlTypeIntro }
+     * Create an instance of {@link XmlElementIntro }
      * 
      */
-    public XmlTypeIntro createXmlTypeIntro() {
-        return new XmlTypeIntro();
+    public XmlElementIntro createXmlElementIntro() {
+        return new XmlElementIntro();
     }
 
     /**
@@ -87,27 +105,27 @@
     }
 
     /**
-     * Create an instance of {@link XmlElementIntro }
+     * Create an instance of {@link ClassMemberIntroConfig }
      * 
      */
-    public XmlElementIntro createXmlElementIntro() {
-        return new XmlElementIntro();
+    public ClassMemberIntroConfig createClassMemberIntroConfig() {
+        return new ClassMemberIntroConfig();
     }
 
     /**
-     * Create an instance of {@link ClassIntroConfig }
+     * Create an instance of {@link XmlTypeIntro }
      * 
      */
-    public ClassIntroConfig createClassIntroConfig() {
-        return new ClassIntroConfig();
+    public XmlTypeIntro createXmlTypeIntro() {
+        return new XmlTypeIntro();
     }
 
     /**
-     * Create an instance of {@link JaxbIntros }
+     * Create an instance of {@link XmlAccessorTypeIntro }
      * 
      */
-    public JaxbIntros createJaxbIntros() {
-        return new JaxbIntros();
+    public XmlAccessorTypeIntro createXmlAccessorTypeIntro() {
+        return new XmlAccessorTypeIntro();
     }
 
     /**
@@ -120,6 +138,15 @@
     }
 
     /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link XmlRootElementIntro }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://www.jboss.org/xsd/jaxb/intros", name = "XmlRootElement")
+    public JAXBElement<XmlRootElementIntro> createXmlRootElement(XmlRootElementIntro value) {
+        return new JAXBElement<XmlRootElementIntro>(_XmlRootElement_QNAME, XmlRootElementIntro.class, null, value);
+    }
+
+    /**
      * Create an instance of {@link JAXBElement }{@code <}{@link ClassIntroConfig }{@code >}}
      * 
      */
@@ -165,6 +192,15 @@
     }
 
     /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link XmlAccessorTypeIntro }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://www.jboss.org/xsd/jaxb/intros", name = "XmlAccessorType")
+    public JAXBElement<XmlAccessorTypeIntro> createXmlAccessorType(XmlAccessorTypeIntro value) {
+        return new JAXBElement<XmlAccessorTypeIntro>(_XmlAccessorType_QNAME, XmlAccessorTypeIntro.class, null, value);
+    }
+
+    /**
      * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
      * 
      */

Added: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAccessorTypeIntro.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAccessorTypeIntro.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAccessorTypeIntro.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -0,0 +1,81 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
+//
+
+
+package org.jboss.jaxb.intros.configmodel;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for XmlAccessorType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="XmlAccessorType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="value" default="NONE">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             &lt;enumeration value="PROPERTY"/>
+ *             &lt;enumeration value="FIELD"/>
+ *             &lt;enumeration value="PUBLIC_MEMBER"/>
+ *             &lt;enumeration value="NONE"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "XmlAccessorType")
+public class XmlAccessorTypeIntro {
+
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    protected String value;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        if (value == null) {
+            return "NONE";
+        } else {
+            return value;
+        }
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+}


Property changes on: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAccessorTypeIntro.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAttributeIntro.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAttributeIntro.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlAttributeIntro.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlElementIntro.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlElementIntro.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlElementIntro.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Added: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlRootElementIntro.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlRootElementIntro.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlRootElementIntro.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -0,0 +1,103 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
+//
+
+
+package org.jboss.jaxb.intros.configmodel;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for XmlRootElement complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="XmlRootElement">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" default="##default" />
+ *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" default="##default" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "XmlRootElement")
+public class XmlRootElementIntro {
+
+    @XmlAttribute
+    @XmlSchemaType(name = "anySimpleType")
+    protected String namespace;
+    @XmlAttribute
+    @XmlSchemaType(name = "anySimpleType")
+    protected String name;
+
+    /**
+     * Gets the value of the namespace property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getNamespace() {
+        if (namespace == null) {
+            return "##default";
+        } else {
+            return namespace;
+        }
+    }
+
+    /**
+     * Sets the value of the namespace property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setNamespace(String value) {
+        this.namespace = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        if (name == null) {
+            return "##default";
+        } else {
+            return name;
+        }
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+}


Property changes on: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlRootElementIntro.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlTypeIntro.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlTypeIntro.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/XmlTypeIntro.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/package-info.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/package-info.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/configmodel/package-info.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.3-b01-fcs 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-b02-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2007.06.28 at 05:23:39 PM BST 
+// Generated on: 2007.08.21 at 10:20:40 PM GMT 
 //
 
 @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jboss.org/xsd/jaxb/intros", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

Added: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAccessorTypeHandler.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAccessorTypeHandler.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAccessorTypeHandler.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.jaxb.intros.handlers;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.jaxb.intros.configmodel.XmlAccessorTypeIntro;
+
+/**
+ * @author <a href="mailto:chris at swaton.org">chris at swaton.org</a>
+ */
+public class XmlAccessorTypeHandler implements InvocationHandler {
+
+    private static final Log logger = LogFactory.getLog(XmlAccessorTypeHandler.class);
+    private XmlAccessorTypeIntro xmlAccessorTypeIntro;
+
+    private XmlAccessorTypeHandler(XmlAccessorTypeIntro xmlAccessorTypeIntro) {
+        this.xmlAccessorTypeIntro = xmlAccessorTypeIntro;
+    }
+
+    public static Annotation createProxy(XmlAccessorTypeIntro xmlAccessorTypeIntro) {
+        return (Annotation) Proxy.newProxyInstance(XmlAccessorType.class.getClassLoader(),
+                                          new Class[] { XmlAccessorType.class, ClassValue.class },
+                                          new XmlAccessorTypeHandler(xmlAccessorTypeIntro));
+    }
+
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        /*
+        <xsd:complexType>
+          <xsd:attribute name="value" use="optional" default="NONE">
+            <xsd:simpleType>
+              <xsd:restriction base="xsd:NMTOKEN">
+                <xsd:enumeration value="PROPERTY"/>
+                <xsd:enumeration value="FIELD"/>
+                <xsd:enumeration value="PUBLIC_MEMBER"/>
+                <xsd:enumeration value="NONE"/>
+              </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
+        </xsd:complexType>
+        */
+
+        String methodName = method.getName();
+        if(methodName.equals("value")) {
+            return XmlAccessType.valueOf(xmlAccessorTypeIntro.getValue());
+        }
+        return null;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAccessorTypeHandler.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAttributeHandler.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAttributeHandler.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlAttributeHandler.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -53,12 +53,16 @@
         </xsd:complexType>
          */
 
-        if(method.getName().equals("namespace")) {
+        String methodName = method.getName();
+
+        if(methodName.equals("namespace")) {
             return xmlAttributeIntro.getNamespace();
-        } else if(method.getName().equals("name")) {
+        } else if(methodName.equals("name")) {
             return xmlAttributeIntro.getName();
-        } else if(method.getName().equals("required")) {
+        } else if(methodName.equals("required")) {
             return xmlAttributeIntro.isRequired();
+        } else if(methodName.equals("annotationType")) {
+            return XmlAttribute.class;
         }
 
         return null;

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlElementHandler.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlElementHandler.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlElementHandler.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -82,6 +82,8 @@
                 }
             }
             return XmlElement.DEFAULT.class;
+        } else if(methodName.equals("annotationType")) {
+            return XmlElement.class;
         }
 
         return null;

Added: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlRootElementHandler.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlRootElementHandler.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlRootElementHandler.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.jaxb.intros.handlers;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.jaxb.intros.configmodel.XmlRootElementIntro;
+
+/**
+ * @author <a href="mailto:chris at swaton.org">chris at swaton.org</a>
+ */
+public class XmlRootElementHandler implements InvocationHandler {
+
+    private static final Log logger = LogFactory.getLog(XmlRootElementHandler.class);
+    private XmlRootElementIntro xmlRootElementIntro;
+
+    private XmlRootElementHandler(XmlRootElementIntro xmlRootElementIntro) {
+        this.xmlRootElementIntro = xmlRootElementIntro;
+    }
+
+    public static Annotation createProxy(XmlRootElementIntro xmlRootElementIntro) {
+        return (Annotation) Proxy.newProxyInstance(XmlRootElement.class.getClassLoader(),
+                                          new Class[] { XmlRootElement.class, ClassValue.class },
+                                          new XmlRootElementHandler(xmlRootElementIntro));
+    }
+
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        /*
+        <xsd:complexType>
+            <xsd:attribute name="namespace" use="optional" default="##default"/>
+            <xsd:attribute name="name" use="optional" default="##default"/>
+        </xsd:complexType>
+        */
+
+        String methodName = method.getName();
+        if(methodName.equals("namespace")) {
+            return xmlRootElementIntro.getNamespace();
+        } else if(methodName.equals("name")) {
+            return xmlRootElementIntro.getName();
+        }
+        return null;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlRootElementHandler.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlTypeHandler.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlTypeHandler.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/jaxb/intros/handlers/XmlTypeHandler.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -21,7 +21,8 @@
 
 import org.jboss.jaxb.intros.configmodel.XmlTypeIntro;
 import org.jboss.jaxb.intros.ConfigurationException;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.bind.annotation.XmlType;
 import java.lang.reflect.InvocationHandler;
@@ -34,7 +35,7 @@
  */
 public class XmlTypeHandler implements InvocationHandler {
 
-    private static Logger logger = Logger.getLogger(XmlTypeHandler.class);
+    private static final Log logger = LogFactory.getLog(XmlTypeHandler.class);
     private XmlTypeIntro xmlTypeIntro;
 
     private XmlTypeHandler(XmlTypeIntro xmlTypeIntro) {

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/wsf/spi/deployment/JAXBIntrosCustomizationsDeployer.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/wsf/spi/deployment/JAXBIntrosCustomizationsDeployer.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/java/org/jboss/wsf/spi/deployment/JAXBIntrosCustomizationsDeployer.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -25,7 +25,8 @@
 import org.jboss.wsf.spi.binding.BindingCustomization;
 import org.jboss.ws.core.jaxws.JAXBBindingCustomization;
 import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import java.io.InputStream;
 import java.io.IOException;
@@ -42,7 +43,7 @@
  */
 public class JAXBIntrosCustomizationsDeployer extends AbstractDeployer {
 
-    private static Logger logger = Logger.getLogger(JAXBIntrosCustomizationsDeployer.class);
+    private static final Log logger = LogFactory.getLog(JAXBIntrosCustomizationsDeployer.class);
     private static final String META_INF_JAXB_INTROS_XML = "META-INF/jaxb-intros.xml";
 
     public void create(Deployment deployment) {

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/main/resources/jaxb-intros.xsd
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/main/resources/jaxb-intros.xsd	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/main/resources/jaxb-intros.xsd	2007-09-13 13:55:30 UTC (rev 15088)
@@ -20,7 +20,9 @@
 
     <xsd:complexType name="Class">
         <xsd:sequence>
+            <xsd:element ref="jaxb-intros:XmlAccessorType" minOccurs="0" maxOccurs="1"/>
             <xsd:element ref="jaxb-intros:XmlType" minOccurs="0" maxOccurs="1"/>
+            <xsd:element ref="jaxb-intros:XmlRootElement" minOccurs="0" maxOccurs="1"/>
             <xsd:element ref="jaxb-intros:Field" minOccurs="0" maxOccurs="unbounded"/>
             <xsd:element ref="jaxb-intros:Method" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
@@ -69,6 +71,26 @@
         </xsd:annotation>
     </xsd:element>
 
+    <xsd:complexType name="XmlAccessorType">
+        <xsd:attribute name="value" use="optional" default="NONE">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:NMTOKEN">
+                    <xsd:enumeration value="PROPERTY"/>
+                    <xsd:enumeration value="FIELD"/>
+                    <xsd:enumeration value="PUBLIC_MEMBER"/>
+                    <xsd:enumeration value="NONE"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+        </xsd:attribute>
+    </xsd:complexType>
+    <xsd:element name="XmlAccessorType" type="jaxb-intros:XmlAccessorType" />
+
+    <xsd:complexType name="XmlRootElement">
+        <xsd:attribute name="namespace" use="optional" default="##default"/>
+        <xsd:attribute name="name" use="optional" default="##default"/>
+    </xsd:complexType>
+    <xsd:element name="XmlRootElement" type="jaxb-intros:XmlRootElement"/>
+
     <xsd:complexType name="XmlType">
         <xsd:attribute name="name" use="optional" default="##default"/>
         <xsd:attribute name="propOrder" use="optional" default=""/>

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/IntroductionsAnnotationReaderUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/IntroductionsAnnotationReaderUnitTest.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/IntroductionsAnnotationReaderUnitTest.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -90,7 +90,9 @@
         assertNotNull("null Header", order.getHeader());
         assertNotNull("null Items", order.getItems());
         assertEquals("Shelton", order.getHeader().getBillTo().getAddress().getCity());
+        assertEquals("06484", order.getHeader().getBillTo().getAddress().getZip());
         assertEquals("bob at activeSteel.com", order.getHeader().getBillTo().getContact().getEmail());
+        assertEquals(1146441600000L, order.getHeader().getOrderDate().getTimeInMillis());
         assertEquals((new BigDecimal(490.00)).toBigInteger(), (order.getItems()[0].getPrice()).toBigInteger());
     }
 }

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/intro-config-03.xml
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/intro-config-03.xml	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/intro-config-03.xml	2007-09-13 13:55:30 UTC (rev 15088)
@@ -20,6 +20,25 @@
         </Method>
     </Class>
 
+    <Class name="org.jboss.jaxb.intros.testbeans.OrderHeader">
+        <Method name="getOrderDate">
+            <XmlAttribute name="date" namespace="http://org.jboss.esb/ns" />
+        </Method>
+        <Method name="get.*">
+            <XmlElement namespace="http://org.jboss.esb/ns1" />
+        </Method>
+    </Class>
+
+    <Class name="org.jboss.jaxb.intros.testbeans.Address">
+        <XmlAccessorType value="FIELD" />
+        <Field name="zip">
+            <XmlAttribute />
+        </Field>
+        <Field name=".*">
+            <XmlElement namespace="http://org.jboss.esb/ns1" />
+        </Field>
+    </Class>
+
     <!--
     More general namespace config...
     -->

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/order-message.xml
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/order-message.xml	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/order-message.xml	2007-09-13 13:55:30 UTC (rev 15088)
@@ -1,13 +1,12 @@
 <ns:customerOrder xmlns:ns="http://org.jboss.esb/ns" xmlns:ns1="http://org.jboss.esb/ns1">
-    <ns:header>
+    <ns:header ns:date="2006-05-01T00:00:00.000Z">
         <ns1:billTerms/>
         <ns1:billTo>
-            <ns1:address>
+            <ns1:address zip="06484">
                 <ns1:city>Shelton</ns1:city>
                 <ns1:state>CT</ns1:state>
                 <ns1:street1>160 Active Lane</ns1:street1>
                 <ns1:street2/>
-                <ns1:zip>06484</ns1:zip>
             </ns1:address>
             <ns1:company>Active Steel</ns1:company>
             <ns1:contact>
@@ -18,7 +17,6 @@
             </ns1:contact>
         </ns1:billTo>
         <ns1:customerNumber>123456</ns1:customerNumber>
-        <ns1:orderDate>2006-05-01T00:00:00.000Z </ns1:orderDate>
         <ns1:orderTotal>88500.00</ns1:orderTotal>
         <ns1:poNumber>PO000123</ns1:poNumber>
         <ns1:shipTerms/>

Modified: labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/testbeans/Address.java
===================================================================
--- labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/testbeans/Address.java	2007-09-13 13:13:48 UTC (rev 15087)
+++ labs/jbossesb/trunk/product/extras/jaxbintros/src/test/java/org/jboss/jaxb/intros/testbeans/Address.java	2007-09-13 13:55:30 UTC (rev 15088)
@@ -4,42 +4,65 @@
 
 public class Address implements Serializable {
 
-protected String street1;
+    protected String street1;
 
-protected String street2;
+    protected String street2;
 
-protected String city;
+    protected String city;
 
-protected String state;
+    protected String state;
 
-protected String zip;
-public Address(){}
+    protected String zip;
 
-public Address(String street1, String street2, String city, String state, String zip){
-this.street1=street1;
-this.street2=street2;
-this.city=city;
-this.state=state;
-this.zip=zip;
-}
-public String getStreet1() { return street1 ;}
+    public Address() {
+    }
 
-public void setStreet1(String street1){ this.street1=street1; }
+    public Address(String street1, String street2, String city, String state, String zip) {
+        this.street1 = street1;
+        this.street2 = street2;
+        this.city = city;
+        this.state = state;
+        this.zip = zip;
+    }
 
-public String getStreet2() { return street2 ;}
+    public String getStreet1() {
+        return street1;
+    }
 
-public void setStreet2(String street2){ this.street2=street2; }
+    public void setStreet1(String street1) {
+        this.street1 = street1;
+    }
 
-public String getCity() { return city ;}
+    public String getStreet2() {
+        return street2;
+    }
 
-public void setCity(String city){ this.city=city; }
+    public void setStreet2(String street2) {
+        this.street2 = street2;
+    }
 
-public String getState() { return state ;}
+    public String getCity() {
+        return city;
+    }
 
-public void setState(String state){ this.state=state; }
+    public void setCity(String city) {
+        this.city = city;
+    }
 
-public String getZip() { return zip ;}
+    public String getState() {
+        return state;
+    }
 
-public void setZip(String zip){ this.zip=zip; }
+    public void setState(String state) {
+        this.state = state;
+    }
 
+    public String getZip() {
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
 }




More information about the jboss-svn-commits mailing list