cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r599917 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/xmlschema/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/
Date Fri, 30 Nov 2007 19:17:48 GMT
Author: dkulp
Date: Fri Nov 30 11:17:47 2007
New Revision: 599917

URL: http://svn.apache.org/viewvc?rev=599917&view=rev
Log:
Merged revisions 597906 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r597906 | bimargulies | 2007-11-24 14:37:49 -0500 (Sat, 24 Nov 2007) | 2 lines
  
  Impose some structure on the use of the QName and refName attributes of XmlSchemaElements.
Fix case in JAXB where they were both set (bad) inconsistently (worse).
........

Added:
    incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaInvalidOperation.java
      - copied unchanged from r597906, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaInvalidOperation.java
    incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaTools.java
      - copied unchanged from r597906, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaTools.java
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=599917&r1=599916&r2=599917&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Fri Nov 30 11:17:47 2007
@@ -34,6 +34,7 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.common.xmlschema.XmlSchemaTools;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.service.ServiceModelVisitor;
 import org.apache.cxf.service.model.FaultInfo;
@@ -190,8 +191,7 @@
 
     private XmlSchemaElement createXsElement(MessagePartInfo part, QName typeName, SchemaInfo
schemaInfo) {
         XmlSchemaElement el = new XmlSchemaElement();
-        el.setQName(part.getElementQName());
-        el.setName(part.getElementQName().getLocalPart());
+        XmlSchemaTools.setElementQName(el, part.getElementQName());
         el.setNillable(true);
         el.setSchemaTypeName(typeName);
         part.setXmlSchema(el);
@@ -214,8 +214,7 @@
                 && !isExistSchemaElement(schemaInfo.getSchema(), part.getElementQName()))
{
                     
                 XmlSchemaElement el = new XmlSchemaElement();
-                el.setQName(part.getElementQName());
-                el.setName(part.getElementQName().getLocalPart());
+                XmlSchemaTools.setElementQName(el, part.getElementQName());
                 el.setNillable(true);
                 
                 schemaInfo.getSchema().getItems().add(el);
@@ -248,8 +247,7 @@
             }
                 
             XmlSchemaElement el = new XmlSchemaElement();
-            el.setQName(part.getElementQName());
-            el.setName(part.getElementQName().getLocalPart());
+            XmlSchemaTools.setElementQName(el, part.getElementQName());
             
             schemaInfo.getSchema().getItems().add(el);
             schemaInfo.getSchema().getElements().add(el.getQName(), el);
@@ -278,8 +276,8 @@
                             String ns = schemaInfo.getSchema().getElementFormDefault()
                                 .getValue().equals(XmlSchemaForm.UNQUALIFIED) 
                                 ? "" : part.getElementQName().getLocalPart();
-                            el.setQName(new QName(ns, m.getName().substring(beginIdx)));
-                            
+                            XmlSchemaTools.setElementQName(el, 
+                                                           new QName(ns, m.getName().substring(beginIdx)));
                             Iterator<QName> itr = beanInfo.getTypeNames().iterator();
                             if (!itr.hasNext()) {
                                 return;
@@ -334,8 +332,7 @@
         }
         
         XmlSchemaElement el = new XmlSchemaElement();
-        el.setQName(part.getElementQName());
-        el.setName(part.getElementQName().getLocalPart());
+        XmlSchemaTools.setElementQName(el, part.getElementQName());
         schema.getItems().add(el);
         schema.getElements().add(el.getQName(), el);
         part.setXmlSchema(el);
@@ -382,7 +379,7 @@
     public void addElement(XmlSchemaSequence seq, JaxBeanInfo<?> beanInfo, QName name)
{    
         XmlSchemaElement el = new XmlSchemaElement();
         el.setName(name.getLocalPart());
-        el.setQName(name);
+        XmlSchemaTools.setElementQName(el, name);
 
         el.setMinOccurs(1);
         el.setMaxOccurs(1);
@@ -392,7 +389,8 @@
             QName ename = new QName(beanInfo.getElementNamespaceURI(null), 
                                    beanInfo.getElementLocalName(null));
             XmlSchemaElement el2 = schemas.getElementByQName(ename);
-            el.setRefName(el2.getRefName());
+            XmlSchemaTools.setElementQName(el, null);
+            XmlSchemaTools.setElementRefName(el, el2.getRefName());
         } else {
             Iterator<QName> itr = beanInfo.getTypeNames().iterator();
             if (!itr.hasNext()) {

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=599917&r1=599916&r2=599917&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Nov 30 11:17:47 2007
@@ -49,6 +49,7 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.common.xmlschema.XmlSchemaTools;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.endpoint.EndpointImpl;
@@ -639,8 +640,7 @@
         XmlSchema schema = si.getSchema();
 
         XmlSchemaElement el = new XmlSchemaElement();
-        el.setQName(mpi.getElementQName());
-        el.setName(mpi.getElementQName().getLocalPart());
+        XmlSchemaTools.setElementQName(el, mpi.getElementQName());
         if (!isExistSchemaElement(schema, mpi.getElementQName())) {
             SchemaCollection.addGlobalElementToSchema(schema, el);
         }
@@ -744,8 +744,7 @@
             }
 
             XmlSchemaElement el = new XmlSchemaElement();
-            el.setQName(qname);
-            el.setName(qname.getLocalPart());
+            XmlSchemaTools.setElementQName(el, qname);
             el.setMinOccurs(1);
             el.setMaxOccurs(0);
             el.setNillable(true);
@@ -835,8 +834,7 @@
                                             XmlSchema schema,
                                             QName wrapperName) {
         XmlSchemaElement el = new XmlSchemaElement();
-        el.setQName(wrapperName);
-        el.setName(wrapperName.getLocalPart());
+        XmlSchemaTools.setElementQName(el, wrapperName);
         SchemaCollection.addGlobalElementToSchema(schema, el);
 
         wrappedMessage.getMessageParts().get(0).setXmlSchema(el);
@@ -857,11 +855,11 @@
         for (MessagePartInfo mpi : unwrappedMessage.getMessageParts()) {
 
             el = new XmlSchemaElement();
-            el.setName(mpi.getName().getLocalPart());
-            el.setQName(mpi.getName());
+            XmlSchemaTools.setElementQName(el, mpi.getName());
             if (mpi.isElement()) {
                 addImport(schema, mpi.getElementQName().getNamespaceURI());
-                el.setRefName(mpi.getElementQName());
+                XmlSchemaTools.setElementQName(el, null);
+                XmlSchemaTools.setElementRefName(el, mpi.getElementQName());
             } else {
                 if (mpi.getTypeQName() != null) {
                     el.setSchemaTypeName(mpi.getTypeQName());
@@ -923,8 +921,7 @@
             if (Boolean.TRUE.equals(mpi.getProperty(HEADER))) {
                 QName qn = (QName)mpi.getProperty(ELEMENT_NAME);
 
-                el.setName(qn.getLocalPart());
-                el.setQName(qn);
+                XmlSchemaTools.setElementQName(el, qn);
 
                 SchemaInfo headerSchemaInfo = getOrCreateSchema(serviceInfo, 
                                                                 qn.getNamespaceURI(),



Mime
View raw message