FileDocCategorySizeDatePackage
Base64Deserializer.javaAPI DocApache Axis 1.42088Sat Apr 22 18:57:28 BST 2006org.apache.axis.encoding.ser

Base64Deserializer

public class Base64Deserializer extends SimpleDeserializer
Deserializer for Base64
author
Sam Ruby Modified by @author Rich scheuerle
see
XML Schema 3.2.16

Fields Summary
Constructors Summary
public Base64Deserializer(Class javaType, QName xmlType)

        super(javaType, xmlType);
    
Methods Summary
public java.lang.ObjectmakeValue(java.lang.String source)
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
source the serialized value to be deserialized
throws
Exception any exception thrown by this method will be wrapped

        byte [] value = Base64.decode(source);
        
        if (value == null) {
            if (javaType == Byte[].class) {
                return new Byte[0];
            } else {
                return new byte[0];
            }
        }
        
        if (javaType == Byte[].class) {
            Byte[] data = new Byte[ value.length ];
            for (int i=0; i<data.length; i++) {
                byte b = value[i];
                data[i] = new Byte(b);
            }
            return data;
        }
        return value;