You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2002/05/25 05:46:47 UTC
cvs commit: xml-axis/java/test/encoding DataDeser.java
gdaniels 02/05/24 20:46:46
Modified: java/samples/encoding DataDeser.java
java/src/org/apache/axis/encoding
DeserializationContext.java Deserializer.java
java/src/org/apache/axis/encoding/ser ArrayDeserializer.java
Base64Deserializer.java BeanDeserializer.java
ElementDeserializer.java HexDeserializer.java
JAFDataHandlerDeserializer.java
MapDeserializer.java SimpleDeserializer.java
VectorDeserializer.java
java/src/org/apache/axis/message BodyBuilder.java
EnvelopeBuilder.java MessageElement.java
RPCHandler.java SOAPFaultBuilder.java
java/test/encoding DataDeser.java
Added: java/src/org/apache/axis/encoding DeserializerImpl.java
Log:
Roll back Deserializer interface -> class change for Rich.
Revision Changes Path
1.3 +3 -4 xml-axis/java/samples/encoding/DataDeser.java
Index: DataDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/encoding/DataDeser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DataDeser.java 24 May 2002 18:20:41 -0000 1.2
+++ DataDeser.java 25 May 2002 03:46:46 -0000 1.3
@@ -2,7 +2,7 @@
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.FieldTarget;
import org.apache.axis.Constants;
import org.apache.axis.message.SOAPHandler;
@@ -10,10 +10,9 @@
import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
import java.util.Hashtable;
-public class DataDeser extends Deserializer
+public class DataDeser extends DeserializerImpl
{
public static final String STRINGMEMBER = "stringMember";
public static final String FLOATMEMBER = "floatMember";
@@ -63,6 +62,6 @@
if (dSer == null)
throw new SAXException("No deserializer for a " + typeQName + "???");
- return dSer;
+ return (SOAPHandler)dSer;
}
}
1.45 +1 -1 xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java
Index: DeserializationContext.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- DeserializationContext.java 26 Jan 2002 02:40:33 -0000 1.44
+++ DeserializationContext.java 25 May 2002 03:46:46 -0000 1.45
@@ -154,7 +154,7 @@
/**
* Convenenience method that returns true if the value is nil
* (due to the xsi:nil) attribute.
- * @param attributes are the element attributes.
+ * @param attrs are the element attributes.
* @return true if xsi:nil is true
*/
public boolean isNil(Attributes attrs);
1.31 +80 -338 xml-axis/java/src/org/apache/axis/encoding/Deserializer.java
Index: Deserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Deserializer.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Deserializer.java 24 May 2002 18:20:42 -0000 1.30
+++ Deserializer.java 25 May 2002 03:46:46 -0000 1.31
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -53,114 +53,77 @@
* <http://www.apache.org/>.
*/
-package org.apache.axis.encoding;
-import org.apache.axis.Constants;
+package org.apache.axis.encoding;
-import org.apache.axis.message.EnvelopeHandler;
-import org.apache.axis.message.MessageElement;
-import org.apache.axis.message.SAX2EventRecorder;
-import org.apache.axis.message.SAXOutputter;
import org.apache.axis.message.SOAPHandler;
-import org.apache.axis.Part;
-import org.apache.axis.utils.JavaUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-import org.apache.axis.encoding.Target;
import javax.xml.rpc.namespace.QName;
-
-import java.io.StringWriter;
-import java.util.Enumeration;
import java.util.Vector;
-/** The Deserializer base class.
- *
- * @author Glen Daniels (gdaniels@allaire.com)
- * Re-architected for JAX-RPC Compliance by
- * @author Rich Scheuerle (sche@us.ibm.com)
- */
-
-public class Deserializer extends SOAPHandler
- implements javax.xml.rpc.encoding.Deserializer
-{
- protected static Log log =
- LogFactory.getLog(Deserializer.class.getName());
-
- protected Object value = null;
-
- // isEnded is set when the endElement is called
- protected boolean isEnded = false;
-
- protected Vector targets = null;
-
- protected QName defaultType = null;
- private boolean componentsReady = true;
-
+/**
+ * This interface describes the AXIS Deserializer.
+ * A compliant implementiation must extend either
+ * the AXIS SoapHandler (org.apache.axis.message.SOAPHandler)
+ * or the AXIS DeserializerImpl (org.apache.axis.encoding.DeserializerImpl)
+ *
+ * The DeserializerImpl provides a lot of the default behavior including the
+ * support for id/href. So you may want to try extending it as opposed to
+ * extending SoapHandler.
+ *
+ * An Axis compliant Deserializer must provide one or more
+ * of the following methods:
+ *
+ * public <constructor>(Class javaType, QName xmlType)
+ * public <constructor>()
+ *
+ * This will allow for construction of generic factories that introspect the class
+ * to determine how to construct a deserializer.
+ * The xmlType, javaType arguments are filled in with the values known by the factory.
+g */
+public interface Deserializer extends javax.xml.rpc.encoding.Deserializer, Callback {
- /**
- * JAX-RPC compliant method which returns mechanism type.
- */
- public String getMechanismType() {
- return Constants.AXIS_SAX;
- }
-
- /**
+ /**
* Get the deserialized value.
* @return Object representing deserialized value or null
*/
- public Object getValue()
- {
- return value;
- }
- /**
+ public Object getValue();
+
+ /**
* Set the deserialized value.
* @param value Object representing deserialized value
*/
- public void setValue(Object value)
- {
- this.value = value;
- }
+ public void setValue(Object value);
- /**
+ /**
* If the deserializer has component values (like ArrayDeserializer)
* this method gets the specific component via the hint.
* The default implementation returns null.
* @return Object representing deserialized value or null
*/
- public Object getValue(Object hint)
- {
- return null;
- }
+ public Object getValue(Object hint);
- /**
+ /**
* If the deserializer has component values (like ArrayDeserializer)
* this method sets the specific component via the hint.
* The default implementation does nothing.
- * @param hint Object representing deserialized value or null
+ * @param value Object representing deserialized value or null
*/
- public void setValue(Object value, Object hint) throws SAXException
- {
- }
+ public void setValue(Object value, Object hint) throws SAXException;
- /**
- * In some circumstances an element may not have
+ /**
+ * In some circumstances an element may not have
* a type attribute, but a default type qname is known from
* information in the container. For example,
- * an element of an array may not have a type= attribute,
+ * an element of an array may not have a type= attribute,
* so the default qname is the component type of the array.
- * This method is used to communicate the default type information
+ * This method is used to communicate the default type information
* to the deserializer.
*/
- public void setDefaultType(QName qName) {
- defaultType = qName;
- }
- public QName getDefaultType() {
- return defaultType;
- }
+ public void setDefaultType(QName qName);
+ public QName getDefaultType();
/**
* For deserializers of non-primitives, the value may not be
@@ -170,58 +133,32 @@
* each Target registered with the Deserializer. The Target
* object abstracts the function of setting a target with a
* value. See the Target interface for more info.
- * @param target
+ * @param target Target
*/
- public void registerValueTarget(Target target)
- {
- if (targets == null)
- targets = new Vector();
-
- targets.addElement(target);
- }
-
+ public void registerValueTarget(Target target);
+
/**
* Get the Value Targets of the Deserializer.
* @return Vector of Target objects or null
*/
- public Vector getValueTargets() {
- return targets;
- }
-
+ public Vector getValueTargets();
+
/**
* Remove the Value Targets of the Deserializer.
*/
- public void removeValueTargets() {
- if (targets != null) {
- targets.clear();
- targets = null;
- }
- }
+ public void removeValueTargets() ;
- /**
+ /**
* Move someone else's targets to our own (see DeserializationContext)
*
- * The DeserializationContext only allows one Deserializer to
+ * The DeserializationContext only allows one Deserializer to
* wait for a unknown multi-ref'ed value. So to ensure
* that all of the targets are updated, this method is invoked
* to copy the Target objects to the waiting Deserializer.
* @param other is the Deserializer to copy targets from.
*/
- public void moveValueTargets(Deserializer other)
- {
- if ((other == null) || (other.getValueTargets() == null))
- return;
-
- if (targets == null)
- targets = new Vector();
-
- Enumeration e = other.getValueTargets().elements();
- while (e.hasMoreElements()) {
- targets.addElement(e.nextElement());
- }
- other.removeValueTargets();
- }
-
+ public void moveValueTargets(Deserializer other);
+
/**
* Some deserializers (ArrayDeserializer) require
* all of the component values to be known before the
@@ -234,11 +171,9 @@
* This routine is used to indicate when the components are ready.
* The default (true) is useful for most Deserializers.
*/
- public boolean componentsReady() {
- return componentsReady;
- }
+ public boolean componentsReady();
- /**
+ /**
* The valueComplete() method is invoked when the
* end tag of the element is read. This results
* in the setting of all registered Targets (see
@@ -249,33 +184,13 @@
* specific Deserializer will need to call valueComplete()
* when your components are ready (See ArrayDeserializer)
*/
- public void valueComplete() throws SAXException
- {
- if (componentsReady()) {
- if (targets != null) {
- Enumeration e = targets.elements();
- while (e.hasMoreElements()) {
- Target target = (Target)e.nextElement();
- target.set(value);
- if (log.isDebugEnabled()) {
- log.debug(JavaUtils.getMessage("setValueInTarget00",
- "" + value, "" + target));
- }
- }
- // Don't need targets any more, so clear them
- removeValueTargets();
- }
- }
- }
-
- private int startIdx = 0;
- private int endIdx = -1;
- protected boolean isHref = false;
- protected boolean isNil = false; // xsd:nil attribute is set to true
- protected String id = null; // Set to the id of the element
-
- /**
- * Subclasses may override these
+ public void valueComplete() throws SAXException;
+
+
+ /**
+ * The following are the SAX specific methods.
+ * DeserializationImpl provides default behaviour, which
+ * in most cases is appropriate.
*/
/**
@@ -300,14 +215,15 @@
* This results in a call to FooDeserializer.onStartElement(...) if startElement was
* not overridden.
* 4) The onChildElement(...) method is called for each child element. Nothing occurs
- * if not overridden. The FooDeserializer.onStartChild(...) method should return
+ * if not overridden. The FooDeserializer.onStartChild(...) method should return
* the deserializer for the child element.
- * 5) When the end tag is reached, the endElement(..) method is invoked. The default
+ * 5) When the end tag is reached, the endElement(..) method is invoked. The default
* behavior is to handle hrefs/ids, call onEndElement and then call the Deserializer
* valueComplete method.
- *
+ *
* So the methods that you potentially want to override are:
- * onStartElement, onStartChild, componentsReady, setValue(object, hint)
+ * onStartElement, onStartChild, componentsReady, set(object, hint)
+ *
* You probably should not override startElement or endElement.
* If you need specific behaviour at the end of the element consider overriding
* onEndElement.
@@ -317,88 +233,7 @@
public void startElement(String namespace, String localName,
String qName, Attributes attributes,
DeserializationContext context)
- throws SAXException
- {
- super.startElement(namespace, localName, qName, attributes, context);
-
- // If the xsi:nil attribute, set the value to null and return since
- // there is nothing to deserialize.
- String nil = Constants.getValue(attributes,
- Constants.URIS_SCHEMA_XSI,
- "nil");
- if (nil != null && nil.equals("true")) {
- value = null;
- isNil = true;
- return;
- }
-
- // If this element has an id, then associate the value with the id.
- // (Prior to this association, the MessageElement of the element is
- // associated with the id. Failure to replace the MessageElement at this
- // point will cause an infinite loop during deserialization if the
- // current element contains child elements that cause an href back to this id.)
- // Also note that that endElement() method is responsible for the final
- // association of this id with the completed value.
- id = attributes.getValue("id");
- if (id != null) {
- context.addObjectById(id, value);
- if (log.isDebugEnabled()) {
- log.debug(JavaUtils.getMessage("deserInitPutValueDebug00", "" + value, id));
- }
- context.registerFixup("#" + id, this);
- }
-
- String href = attributes.getValue("href");
- if (href != null) {
- isHref = true;
-
- Object ref = context.getObjectByRef(href);
- if (log.isDebugEnabled()) {
- log.debug(JavaUtils.getMessage(
- "gotForID00",
- new String[] {"" + ref, href, (ref == null ? "*null*" : ref.getClass().toString())}));
- }
-
- if (ref == null) {
- // Nothing yet... register for later interest.
- context.registerFixup(href, this);
- componentsReady = false;
- return;
- }
-
- if (ref instanceof MessageElement) {
- context.replaceElementHandler(new EnvelopeHandler(this));
-
- SAX2EventRecorder r = context.getRecorder();
- context.setRecorder(null);
- ((MessageElement)ref).publishToHandler((DefaultHandler) context);
- context.setRecorder(r);
- } else {
-
- if( !href.startsWith("#") && defaultType != null && ref instanceof Part ){
- //For attachments this is the end of the road-- invoke deserializer
- Deserializer dser= context.getDeserializerForType(defaultType );
- if(null != dser){
- dser.startElement(namespace, localName,
- qName, attributes,
- context);
- ref = dser.getValue();
-
- }
- }
-
- // If the ref is not a MessageElement, then it must be an
- // element that has already been deserialized. Use it directly.
- value = ref;
- valueComplete();
- }
-
- } else {
- isHref = false;
- onStartElement(namespace, localName, qName, attributes,
- context);
- }
- }
+ throws SAXException;
/**
* This method is invoked after startElement when the element requires
@@ -407,61 +242,20 @@
* involves obtaining a correct Deserializer and plugging its handler.
* @param namespace is the namespace of the element
* @param localName is the name of the element
- * @param qName is the prefixed qName of the element
+ * @param qName is the prefixed qname of the element
* @param attributes are the attributes on the element...used to get the type
* @param context is the DeserializationContext
*/
public void onStartElement(String namespace, String localName,
String qName, Attributes attributes,
DeserializationContext context)
- throws SAXException
- {
- // If I'm the base class, try replacing myself with an
- // appropriate deserializer gleaned from type info.
- if (this.getClass().equals(Deserializer.class)) {
- QName type = context.getTypeFromAttributes(namespace,
- localName,
- attributes);
- // If no type is specified, use the defaultType if available.
- // xsd:string is used if no type is provided.
- if (type == null) {
- type = defaultType;
- if (type == null) {
- type = Constants.XSD_STRING;
- }
- }
-
- if (log.isDebugEnabled()) {
- log.debug(JavaUtils.getMessage("gotType00", "Deser", "" + type));
- }
-
- // We know we're deserializing, but we don't have
- // a specific deserializer. So create one using the
- // attribute type qname.
- if (type != null) {
- Deserializer dser = context.getDeserializerForType(type);
- if (dser != null) {
- // Move the value targets to the new deserializer
- dser.moveValueTargets(this);
- context.replaceElementHandler((org.apache.axis.message.SOAPHandler) dser);
- // And don't forget to give it the start event...
- dser.startElement(namespace, localName, qName,
- attributes, context);
- } else {
- throw new SAXException(
- JavaUtils.getMessage("noDeser00", "" + type));
- }
- } else {
- startIdx = context.getCurrentRecordPos();
- }
- }
- }
-
+ throws SAXException;
+
/**
* onStartChild is called on each child element.
* The default behavior supplied by DeserializationImpl is to do nothing.
- * A specific deserializer may perform other tasks. For example a
- * BeanDeserializer will construct a deserializer for the indicated
+ * A specific deserializer may perform other tasks. For example a
+ * BeanDeserializer will construct a deserializer for the indicated
* property and return it.
* @param namespace is the namespace of the child element
* @param localName is the local name of the child element
@@ -475,14 +269,9 @@
public SOAPHandler onStartChild(String namespace, String localName,
String prefix, Attributes attributes,
DeserializationContext context)
- throws SAXException
- {
- return null;
- }
-
-
+ throws SAXException;
- /**
+ /**
* endElement is called when the end element tag is reached.
* It handles href/id information for multi-ref processing
* and invokes the valueComplete() method of the deserializer
@@ -491,33 +280,9 @@
* @param localName is the local name of the child element
* @param context is the deserialization context
*/
- public final void endElement(String namespace, String localName,
+ public void endElement(String namespace, String localName,
DeserializationContext context)
- throws SAXException
- {
-
- isEnded = true;
- if (!isHref) {
- onEndElement(namespace, localName, context);
- }
-
- // Time to call valueComplete to copy the value to
- // the targets. First a call is made to componentsReady
- // to ensure that all components are ready.
- if (componentsReady()) {
- valueComplete();
- }
-
- // If this element has an id, then associate the value with the id.
- // Subsequent hrefs to the id will obtain the value directly.
- // This is necessary for proper multi-reference deserialization.
- if (id != null) {
- context.addObjectById(id, value);
- if (log.isDebugEnabled()) {
- log.debug(JavaUtils.getMessage("deserPutValueDebug00", "" + value, id));
- }
- }
- }
+ throws SAXException;
/**
* onEndElement is called by endElement. It is not called
@@ -528,31 +293,8 @@
*/
public void onEndElement(String namespace, String localName,
DeserializationContext context)
- throws SAXException
- {
- // If we only have SAX events, but someone really wanted a
- // value, try sending them the contents of this element
- // as a String...
- // ??? Is this the right thing to do here?
-
- if (this.getClass().equals(Deserializer.class) &&
- targets != null &&
- !targets.isEmpty()) {
- endIdx = context.getCurrentRecordPos();
-
- StringWriter writer = new StringWriter();
- SerializationContextImpl serContext =
- new SerializationContextImpl(writer,
- context.getMessageContext());
- serContext.setSendDecl(false);
-
- SAXOutputter so = null;
- so = new SAXOutputter(serContext);
- context.getCurElement().publishContents(so);
- if (!isNil) {
- value = writer.getBuffer().toString();
- }
- }
- }
-
+ throws SAXException;
+
}
+
+
1.11 +13 -9 xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java
1.13 +4 -4 xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
Index: ArrayDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ArrayDeserializer.java 24 May 2002 18:20:42 -0000 1.12
+++ ArrayDeserializer.java 25 May 2002 03:46:46 -0000 1.13
@@ -58,7 +58,7 @@
import org.apache.axis.Constants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.DeserializerTarget;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.JavaUtils;
@@ -85,7 +85,7 @@
* Multi-reference stuff:
* @author Rich Scheuerle (scheu@us.ibm.com)
*/
-public class ArrayDeserializer extends Deserializer
+public class ArrayDeserializer extends DeserializerImpl
{
protected static Log log =
LogFactory.getLog(ArrayDeserializer.class.getName());
@@ -397,7 +397,7 @@
dSer = context.getDeserializerForType(itemType);
}
if (dSer == null) {
- dSer = new Deserializer();
+ dSer = new DeserializerImpl();
// Determine a default type for the deserializer
if (itemType == null) {
QName defaultType = defaultItemType;
@@ -425,7 +425,7 @@
log.debug("Exit: ArrayDeserializer.onStartChild()");
}
- return dSer;
+ return (SOAPHandler)dSer;
}
/**
1.5 +2 -9 xml-axis/java/src/org/apache/axis/encoding/ser/Base64Deserializer.java
Index: Base64Deserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Base64Deserializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Base64Deserializer.java 24 May 2002 18:20:42 -0000 1.4
+++ Base64Deserializer.java 25 May 2002 03:46:46 -0000 1.5
@@ -55,19 +55,12 @@
package org.apache.axis.encoding.ser;
-import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.Base64;
/**
@@ -77,7 +70,7 @@
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
* @see <a href="http://www.w3.org/TR/xmlschema-2/#base64Binary">XML Schema 3.2.16</a>
*/
-public class Base64Deserializer extends Deserializer {
+public class Base64Deserializer extends DeserializerImpl {
public QName xmlType;
public Class javaType;
1.29 +4 -4 xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
Index: BeanDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- BeanDeserializer.java 25 May 2002 00:03:16 -0000 1.28
+++ BeanDeserializer.java 25 May 2002 03:46:46 -0000 1.29
@@ -60,7 +60,7 @@
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.BeanPropertyDescriptor;
@@ -83,7 +83,7 @@
* @author Rich Scheuerle <sc...@us.ibm.com>
* @author Tom Jordahl <to...@macromedia.com>
*/
-public class BeanDeserializer extends Deserializer implements Serializable
+public class BeanDeserializer extends DeserializerImpl implements Serializable
{
protected static Log log =
LogFactory.getLog(BeanDeserializer.class.getName());
@@ -288,7 +288,7 @@
// There may not be enough information yet to choose the
// specific deserializer.
if (dSer == null) {
- dSer = new Deserializer();
+ dSer = new DeserializerImpl();
// determine a default type for this child element
TypeMapping tm = context.getTypeMapping();
Class type = propDesc.getType();
@@ -310,7 +310,7 @@
collectionIndex));
}
}
- return dSer;
+ return (SOAPHandler)dSer;
}
public BeanPropertyDescriptor getObjectPropertyDesc(QName qname, DeserializationContext context) {
1.8 +6 -21 xml-axis/java/src/org/apache/axis/encoding/ser/ElementDeserializer.java
Index: ElementDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ElementDeserializer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElementDeserializer.java 24 May 2002 18:20:42 -0000 1.7
+++ ElementDeserializer.java 25 May 2002 03:46:46 -0000 1.8
@@ -55,31 +55,16 @@
package org.apache.axis.encoding.ser;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-import org.w3c.dom.Element;
-
-import java.util.ArrayList;
-
import org.apache.axis.MessageContext;
-import org.apache.axis.message.MessageElement;
-import org.apache.axis.message.SOAPHandler;
-
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.Deserializer;
-
+import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.message.MessageElement;
import org.apache.axis.utils.JavaUtils;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.xml.sax.SAXException;
+
+import java.util.ArrayList;
/**
* Deserializer for DOM elements
@@ -87,7 +72,7 @@
* @author Glen Daniels (gdaniels@macromedia.com)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class ElementDeserializer extends Deserializer
+public class ElementDeserializer extends DeserializerImpl
{
protected static Log log =
LogFactory.getLog(ElementDeserializer.class.getName());
1.4 +4 -12 xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java
Index: HexDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HexDeserializer.java 24 May 2002 18:20:42 -0000 1.3
+++ HexDeserializer.java 25 May 2002 03:46:46 -0000 1.4
@@ -55,20 +55,12 @@
package org.apache.axis.encoding.ser;
-import org.xml.sax.Attributes;
+import org.apache.axis.encoding.DeserializationContext;
+import org.apache.axis.encoding.Hex;
+import org.apache.axis.encoding.DeserializerImpl;
import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerFactory;
-import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Hex;
/**
* Deserializer for hexBinary.
@@ -77,7 +69,7 @@
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
* @see <a href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema 3.2.16</a>
*/
-public class HexDeserializer extends Deserializer {
+public class HexDeserializer extends DeserializerImpl {
public QName xmlType;
public Class javaType;
1.6 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java
Index: JAFDataHandlerDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JAFDataHandlerDeserializer.java 24 May 2002 18:20:42 -0000 1.5
+++ JAFDataHandlerDeserializer.java 25 May 2002 03:46:46 -0000 1.6
@@ -57,7 +57,7 @@
import org.apache.axis.attachments.AttachmentUtils;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
@@ -72,7 +72,7 @@
* @author Rick Rineholt
* Modified by Rich Scheuerle <sc...@us.ibm.com>
*/
-public class JAFDataHandlerDeserializer extends Deserializer {
+public class JAFDataHandlerDeserializer extends DeserializerImpl {
protected static Log log =
LogFactory.getLog(JAFDataHandlerDeserializer.class.getName());
1.7 +13 -22 xml-axis/java/src/org/apache/axis/encoding/ser/MapDeserializer.java
Index: MapDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/MapDeserializer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MapDeserializer.java 24 May 2002 18:20:42 -0000 1.6
+++ MapDeserializer.java 25 May 2002 03:46:46 -0000 1.7
@@ -55,31 +55,22 @@
package org.apache.axis.encoding.ser;
+import org.apache.axis.Constants;
+import org.apache.axis.encoding.DeserializationContext;
+import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.DeserializerTarget;
+import org.apache.axis.message.SOAPHandler;
+import org.apache.axis.utils.JavaUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-
import java.util.HashMap;
import java.util.Map;
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerTarget;
-import org.apache.axis.encoding.DeserializerFactory;
-import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.Deserializer;
-
-import org.apache.axis.utils.JavaUtils;
-import org.apache.axis.Constants;
-import org.apache.axis.message.SOAPHandler;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/*
* A <code>MapSerializer</code> is be used to deserialize
* deserialize Maps using the <code>SOAP-ENC</code>
@@ -88,7 +79,7 @@
* @author Glen Daniels (gdaniels@macromedia.com)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class MapDeserializer extends Deserializer {
+public class MapDeserializer extends DeserializerImpl {
protected static Log log =
LogFactory.getLog(MapDeserializer.class.getName());
@@ -186,7 +177,7 @@
* the values into the HashMap we're building.
*
*/
- class ItemHandler extends Deserializer {
+ class ItemHandler extends DeserializerImpl {
Object key;
Object myValue;
int numSet = 0;
@@ -228,7 +219,7 @@
// If no deserializer, use the base DeserializerImpl.
if (dser == null)
- dser = new Deserializer();
+ dser = new DeserializerImpl();
// When the child value is ready, we
// want our set method to be invoked.
@@ -247,7 +238,7 @@
if (dt != null) {
dser.registerValueTarget(dt);
}
- return dser;
+ return (SOAPHandler)dser;
}
}
}
1.16 +4 -4 xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java
Index: SimpleDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SimpleDeserializer.java 25 May 2002 00:03:16 -0000 1.15
+++ SimpleDeserializer.java 25 May 2002 03:46:46 -0000 1.16
@@ -58,13 +58,13 @@
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.SimpleType;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.BeanPropertyDescriptor;
-import org.apache.axis.utils.JavaUtils;
import org.apache.axis.utils.BeanUtils;
+import org.apache.axis.utils.JavaUtils;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -85,7 +85,7 @@
* @author Sam Ruby (rubys@us.ibm.com)
* Modified for JAX-RPC @author Rich Scheuerle (scheu@us.ibm.com)
*/
-public class SimpleDeserializer extends Deserializer {
+public class SimpleDeserializer extends DeserializerImpl {
StringBuffer val = new StringBuffer();
private Constructor constructor = null;
@@ -197,7 +197,7 @@
* Convert the string that has been accumulated into an Object. Subclasses
* may override this. Note that if the javaType is a primitive, the returned
* object is a wrapper class.
- * @param string the serialized value to be deserialized
+ * @param source the serialized value to be deserialized
* @throws Exception any exception thrown by this method will be wrapped
*/
public Object makeValue(String source) throws Exception
1.7 +12 -21 xml-axis/java/src/org/apache/axis/encoding/ser/VectorDeserializer.java
Index: VectorDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorDeserializer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- VectorDeserializer.java 24 May 2002 18:20:42 -0000 1.6
+++ VectorDeserializer.java 25 May 2002 03:46:46 -0000 1.7
@@ -55,29 +55,20 @@
package org.apache.axis.encoding.ser;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-
-import java.util.Vector;
-
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerTarget;
-import org.apache.axis.encoding.DeserializerFactory;
+import org.apache.axis.Constants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-
-import org.apache.axis.utils.JavaUtils;
-import org.apache.axis.Constants;
+import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.DeserializerTarget;
import org.apache.axis.message.SOAPHandler;
-
+import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.xml.rpc.namespace.QName;
+import java.util.Vector;
/**
* Deserializer for SOAP Vectors for compatibility with SOAP 2.2.
@@ -85,7 +76,7 @@
* @author Carsten Ziegeler (cziegeler@apache.org)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class VectorDeserializer extends Deserializer
+public class VectorDeserializer extends DeserializerImpl
{
protected static Log log =
LogFactory.getLog(VectorDeserializer.class.getName());
@@ -165,7 +156,7 @@
dSer = context.getDeserializerForType(itemType);
}
if (dSer == null) {
- dSer = new Deserializer();
+ dSer = new DeserializerImpl();
}
// When the value is deserialized, inform us.
@@ -177,7 +168,7 @@
if (log.isDebugEnabled()) {
log.debug("Exit: VectorDeserializer::onStartChild()");
}
- return dSer;
+ return (SOAPHandler)dSer;
}
/**
1.30 +1 -1 xml-axis/java/src/org/apache/axis/message/BodyBuilder.java
Index: BodyBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/BodyBuilder.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- BodyBuilder.java 24 May 2002 18:20:43 -0000 1.29
+++ BodyBuilder.java 25 May 2002 03:46:46 -0000 1.30
@@ -177,7 +177,7 @@
element = new SOAPBodyElement(namespace, localName, prefix,
attributes, context);
if (element.getFixupDeserializer() != null)
- handler = element.getFixupDeserializer();
+ handler = (SOAPHandler)element.getFixupDeserializer();
}
if (handler == null)
1.19 +1 -1 xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java
Index: EnvelopeBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- EnvelopeBuilder.java 24 May 2002 18:20:43 -0000 1.18
+++ EnvelopeBuilder.java 25 May 2002 03:46:46 -0000 1.19
@@ -163,7 +163,7 @@
attributes, context);
if (element.getFixupDeserializer() != null)
- return element.getFixupDeserializer();
+ return (SOAPHandler)element.getFixupDeserializer();
return null;
}
1.96 +1 -1 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- MessageElement.java 24 May 2002 18:20:43 -0000 1.95
+++ MessageElement.java 25 May 2002 03:46:46 -0000 1.96
@@ -485,7 +485,7 @@
if (dser == null)
throw new Exception(JavaUtils.getMessage("noDeser00", "" + type));
- context.pushElementHandler(new EnvelopeHandler(dser));
+ context.pushElementHandler(new EnvelopeHandler((SOAPHandler)dser));
publishToHandler((org.xml.sax.ContentHandler) context);
1.40 +4 -3 xml-axis/java/src/org/apache/axis/message/RPCHandler.java
Index: RPCHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- RPCHandler.java 24 May 2002 18:20:43 -0000 1.39
+++ RPCHandler.java 25 May 2002 03:46:46 -0000 1.40
@@ -67,6 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.FieldTarget;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -214,7 +215,7 @@
"nil");
if ( isNil != null && isNil.equals("true") )
- return( new Deserializer() );
+ return( new DeserializerImpl() );
Deserializer dser = null;
if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
@@ -224,7 +225,7 @@
if (type != null) {
dser = context.getDeserializerForType(type);
} else {
- dser = new Deserializer();
+ dser = new DeserializerImpl();
}
}
@@ -240,7 +241,7 @@
if (log.isDebugEnabled()) {
log.debug("Exit: RPCHandler.onStartChild()");
}
- return dser;
+ return (SOAPHandler)dser;
}
public void endElement(String namespace, String localName,
1.20 +1 -1 xml-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java
Index: SOAPFaultBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- SOAPFaultBuilder.java 24 May 2002 18:20:43 -0000 1.19
+++ SOAPFaultBuilder.java 25 May 2002 03:46:46 -0000 1.20
@@ -158,7 +158,7 @@
}
}
- return currentDeser;
+ return (SOAPHandler)currentDeser;
}
public void onEndChild(String namespace, String localName,
1.3 +3 -3 xml-axis/java/test/encoding/DataDeser.java
Index: DataDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/DataDeser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DataDeser.java 24 May 2002 18:20:44 -0000 1.2
+++ DataDeser.java 25 May 2002 03:46:46 -0000 1.3
@@ -2,7 +2,7 @@
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.Deserializer;
+import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.encoding.FieldTarget;
import org.apache.axis.Constants;
import org.apache.axis.message.SOAPHandler;
@@ -12,7 +12,7 @@
import javax.xml.rpc.namespace.QName;
import java.util.Hashtable;
-public class DataDeser extends Deserializer
+public class DataDeser extends DeserializerImpl
{
public static final String STRINGMEMBER = "stringMember";
public static final String FLOATMEMBER = "floatMember";
@@ -59,6 +59,6 @@
if (dSer == null)
throw new SAXException("No deserializer for a " + typeQName + "???");
- return dSer;
+ return (SOAPHandler)dSer;
}
}