
META-INF.patches.05-LPS-35125.patch Maven / Gradle / Ivy
diff --git a/org/apache/axis/encoding/ser/MapDeserializer.java b/org/apache/axis/encoding/ser/MapDeserializer.java
index 3794b44..59cbd50 100644
--- a/org/apache/axis/encoding/ser/MapDeserializer.java
+++ b/org/apache/axis/encoding/ser/MapDeserializer.java
@@ -31,6 +31,8 @@ import javax.xml.namespace.QName;
import java.util.HashMap;
import java.util.Map;
+import org.apache.axis.soap.SOAPConstants;
+
/*
* A MapSerializer
is be used to deserialize
* deserialize Maps using the SOAP-ENC
@@ -38,6 +40,7 @@ import java.util.Map;
*
* @author Glen Daniels ([email protected])
* Modified by @author Rich scheuerle
+ * Modified by @author Igor Spasic
*/
public class MapDeserializer extends DeserializerImpl {
@@ -105,16 +108,34 @@ public class MapDeserializer extends DeserializerImpl {
}
if(localName.equals("item")) {
- ItemHandler handler = new ItemHandler(this);
-
- // This item must be complete before we're complete...
- addChildDeserializer(handler);
-
- if (log.isDebugEnabled()) {
- log.debug("Exit: MapDeserializer::onStartChild()");
- }
-
- return handler;
+
+ // liferay - changes started
+ // check if 'href' attribute is present. if so, process it
+ // with BigItemHandler (see bellow)
+ SOAPConstants soapConstants = context.getSOAPConstants();
+ String href = attributes.getValue(soapConstants.getAttrHref());
+
+ if (href != null) {
+ Object ref = context.getObjectByRef(href);
+
+ BigItemHandler handler = new BigItemHandler(this);
+
+ addChildDeserializer(handler);
+
+ return handler;
+ }
+ // liferay - end of changes
+
+ ItemHandler handler = new ItemHandler(this);
+
+ // This item must be complete before we're complete...
+ addChildDeserializer(handler);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Exit: MapDeserializer::onStartChild()");
+ }
+
+ return handler;
}
return this;
@@ -208,4 +229,52 @@ public class MapDeserializer extends DeserializerImpl {
return (SOAPHandler)dser;
}
}
+
+ // liferay - new class
+ // Handles simple items array, where each element has a href
+ // to actual key/value pair
+ class BigItemHandler extends DeserializerImpl {
+ Object key;
+ Object myValue;
+ int numSet = 0;
+ MapDeserializer md = null;
+
+ BigItemHandler(MapDeserializer md) {
+ this.md = md;
+ }
+
+ public SOAPHandler onStartChild(String namespace,
+ String localName,
+ String prefix,
+ Attributes attributes,
+ DeserializationContext context)
+ throws SAXException
+ {
+ QName typeQName = context.getTypeFromAttributes(namespace,
+ localName,
+ attributes);
+ Deserializer dser = context.getDeserializerForType(typeQName);
+
+ if (dser == null)
+ dser = new DeserializerImpl();
+
+
+ SOAPConstants soapConstants = context.getSOAPConstants();
+ String href = attributes.getValue(soapConstants.getAttrHref());
+
+ if (href != null) {
+ Object ref = context.getObjectByRef(href);
+
+ ItemHandler handler = new ItemHandler(md);
+
+ addChildDeserializer(handler);
+
+ return handler;
+ }
+
+ addChildDeserializer(dser);
+ return (SOAPHandler)dser;
+ }
+ }
}
+/* @generated */
\ No newline at end of file
© 2015 - 2025 Weber Informatics LLC | Privacy Policy