You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by du...@apache.org on 2001/11/13 19:26:23 UTC

cvs commit: xml-soap/java/src/org/apache/soap/server TypeMappingSerializer.java

duftler     01/11/13 10:26:23

  Modified:    java/src/org/apache/soap/server TypeMappingSerializer.java
  Log:
  Will now allow a TypeMapping to be specified, without the elementType.
  
  Revision  Changes    Path
  1.9       +13 -5     xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java
  
  Index: TypeMappingSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TypeMappingSerializer.java	2001/03/19 06:20:52	1.8
  +++ TypeMappingSerializer.java	2001/11/13 18:26:23	1.9
  @@ -107,9 +107,11 @@
                                             "' is not defined.");
       }
   
  -    sink.write ("<encodingStyle " + xsiPrefix + ":type=\"" + xsdPrefix + 
  -                ":string\">" + tm.encodingStyle + "</encodingStyle>");
  -    sink.write (StringUtils.lineSeparator);
  +    if (tm.encodingStyle != null) {
  +      sink.write ("<encodingStyle " + xsiPrefix + ":type=\"" + xsdPrefix +
  +                  ":string\">" + tm.encodingStyle + "</encodingStyle>");
  +      sink.write (StringUtils.lineSeparator);
  +    }
   
       if (tm.elementType != null) {
         sink.write ("<elementType-ns " + xsiPrefix + ":type=\"" + xsdPrefix + 
  @@ -161,6 +163,7 @@
       String encodingStyle = null;
       String elTypeNS = null;
       String elTypeLP = null;
  +    QName qname = null;
       String javaType = null;
       String java2XMLClassName = null;
       String xml2JavaClassName = null;
  @@ -191,9 +194,14 @@
                                               "unmarshalling a TypeMapping");
         }
       }
  +
  +    if (elTypeNS != null && elTypeLP != null) {
  +      qname = new QName (elTypeNS, elTypeLP);
  +    }
  +
       return new Bean (TypeMapping.class,
  -                     new TypeMapping (encodingStyle, 
  -                                      new QName (elTypeNS, elTypeLP),
  +                     new TypeMapping (encodingStyle,
  +                                      qname,
                                         javaType,
                                         java2XMLClassName, xml2JavaClassName));
     }