cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r687814 - in /cxf/trunk/rt/frontend: jaxws/src/main/java/org/apache/cxf/jaxws/ jaxws/src/main/java/org/apache/cxf/jaxws/support/ simple/src/main/java/org/apache/cxf/service/factory/
Date Thu, 21 Aug 2008 18:04:42 GMT
Author: dkulp
Date: Thu Aug 21 11:04:42 2008
New Revision: 687814

URL: http://svn.apache.org/viewvc?rev=687814&view=rev
Log:
[CXF-1735] More for cxf-1735 to get the information it needs from the factory (and thus the
configurations)

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=687814&r1=687813&r2=687814&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
Thu Aug 21 11:04:42 2008
@@ -47,6 +47,7 @@
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.jaxb.JAXBUtils;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.MessageInfo;
@@ -66,8 +67,10 @@
     private Set<Class<?>> wrapperBeans = new LinkedHashSet<Class<?>>();
     private InterfaceInfo interfaceInfo;
     private boolean qualified;
+    private JaxWsServiceFactoryBean factory;
     
-    public WrapperClassGenerator(InterfaceInfo inf, boolean q) {
+    public WrapperClassGenerator(JaxWsServiceFactoryBean fact, InterfaceInfo inf, boolean
q) {
+        factory = fact;
         interfaceInfo = inf;
         qualified = q;
     }
@@ -295,21 +298,14 @@
         
         AnnotationVisitor av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;",
true);
         av0.visit("name", name);
-        
-        
-        Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION);
-        if (a != null) {
-            for (Annotation an : a) {
-                String tns = null;
-                if (an instanceof WebParam) {
-                    tns = ((WebParam)an).targetNamespace();
-                } else if (an instanceof WebResult) {
-                    tns = ((WebResult)an).targetNamespace();                    
-                }
-                if (tns != null && !StringUtils.isEmpty(tns)) {
-                    av0.visit("namespace", tns);
-                }
-            }
+        if (factory.isWrapperPartQualified(mpi)) {
+            av0.visit("namespace", mpi.getConcreteName().getNamespaceURI());            
+        }
+        if (factory.isWrapperPartNillable(mpi)) {
+            av0.visit("nillable", "true");
+        }
+        if (factory.getWrapperPartMinOccurs(mpi) == 1) {
+            av0.visit("required", "true");
         }
         av0.visitEnd();
 

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=687814&r1=687813&r2=687814&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Thu Aug 21 11:04:42 2008
@@ -502,7 +502,8 @@
     private Set<Class<?>> generatedWrapperBeanClass() {
         if (getDataBinding() instanceof JAXBDataBinding) {
             ServiceInfo serviceInfo = getService().getServiceInfos().get(0);
-            WrapperClassGenerator wrapperGen = new WrapperClassGenerator(serviceInfo.getInterface(),
+            WrapperClassGenerator wrapperGen = new WrapperClassGenerator(this,
+                                                                         serviceInfo.getInterface(),
                                                                          getQualifyWrapperSchema());
             return wrapperGen.generate();            
         }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=687814&r1=687813&r2=687814&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Aug 21 11:04:42 2008
@@ -1981,7 +1981,7 @@
         return null;
     }
     
-    public Boolean isWrapperPartQualified(MessagePartInfo mpi) {
+    public boolean isWrapperPartQualified(MessagePartInfo mpi) {
         for (AbstractServiceConfiguration c : serviceConfigurations) {
             Boolean b = c.isWrapperPartQualified(mpi);
             if (b != null) {



Mime
View raw message