You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2004/03/23 11:45:06 UTC
cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser SimpleListDeserializer.java SimpleListSerializer.java
dims 2004/03/23 02:45:06
Modified: java/src/org/apache/axis/encoding/ser
SimpleListDeserializer.java
SimpleListSerializer.java
Log:
Fix for AXIS-1258 - xsd:list of QName is not handled properly
from gawor@mcs.anl.gov
Revision Changes Path
1.3 +12 -0 ws-axis/java/src/org/apache/axis/encoding/ser/SimpleListDeserializer.java
Index: SimpleListDeserializer.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/SimpleListDeserializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SimpleListDeserializer.java 25 Feb 2004 14:02:37 -0000 1.2
+++ SimpleListDeserializer.java 23 Mar 2004 10:45:06 -0000 1.3
@@ -53,6 +53,7 @@
private Constructor constructor = null;
private Map propertyMap = null;
private HashMap attributeMap = null;
+ private DeserializationContext context = null;
public QName xmlType;
public Class javaType;
@@ -217,6 +218,15 @@
return new Double(Double.NEGATIVE_INFINITY);
}
}
+ if (javaType == QName.class) {
+ int colon = source.lastIndexOf(":");
+ String namespace = colon < 0 ? "" :
+ context.getNamespaceURI(source.substring(0, colon));
+ String localPart = colon < 0 ? source :
+ source.substring(colon + 1);
+ return new QName(namespace, localPart);
+ }
+
return constructor.newInstance(new Object [] { source });
}
/**
@@ -235,6 +245,8 @@
DeserializationContext context)
throws SAXException
{
+
+ this.context = context;
// If we have no metadata, we have no attributes. Q.E.D.
if (typeDesc == null)
1.3 +9 -2 ws-axis/java/src/org/apache/axis/encoding/ser/SimpleListSerializer.java
Index: SimpleListSerializer.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/SimpleListSerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SimpleListSerializer.java 25 Feb 2004 14:02:37 -0000 1.2
+++ SimpleListSerializer.java 23 Mar 2004 10:45:06 -0000 1.3
@@ -76,9 +76,13 @@
if (value instanceof SimpleType)
attributes = getObjectAttributes(value, attributes, context);
- context.startElement(name, attributes);
+ String strValue = null;
if (value != null) {
- context.writeSafeString(getValueAsString(value, context));
+ strValue = getValueAsString(value, context);
+ }
+ context.startElement(name, attributes);
+ if (strValue != null) {
+ context.writeSafeString(strValue);
}
context.endElement();
}
@@ -110,6 +114,9 @@
else {
result.append(object.toString());
}
+ }
+ else if (object instanceof QName) {
+ result.append( context.qName2String((QName)object) );
}
else {
result.append(object.toString());