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

Base64Serializer

public class Base64Serializer extends Object implements org.apache.axis.encoding.SimpleValueSerializer
Serializer for Base64
author
Sam Ruby Modified by @author Rich Scheuerle
see
XML Schema 3.2.16

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

        this.xmlType = xmlType;
        this.javaType = javaType;
    
Methods Summary
public java.lang.StringgetMechanismType()

 return Constants.AXIS_SAX; 
public java.lang.StringgetValueAsString(java.lang.Object value, org.apache.axis.encoding.SerializationContext context)

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

        return Base64.encode(data, 0, data.length);
    
public voidserialize(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes, java.lang.Object value, org.apache.axis.encoding.SerializationContext context)
Serialize a base64 quantity.

        context.startElement(name, attributes);
        context.writeString(getValueAsString(value, context));
        context.endElement();
    
public org.w3c.dom.ElementwriteSchema(java.lang.Class javaType, org.apache.axis.wsdl.fromJava.Types types)
Return XML schema for the specified type, suitable for insertion into the <types> element of a WSDL document, or underneath an <element> or <attribute> declaration.

param
javaType the Java Class we're writing out schema for
param
types the Java2WSDL Types object which holds the context for the WSDL being generated.
return
a type element containing a schema simpleType/complexType
see
org.apache.axis.wsdl.fromJava.Types

        return null;