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

CalendarSerializer

public class CalendarSerializer extends Object implements org.apache.axis.encoding.SimpleValueSerializer
Serializer for dateTime (Calendar).
author
Sam Ruby Modified by @author Rich scheuerle
see
XML Schema 3.2.16

Fields Summary
private static SimpleDateFormat
zulu
Constructors Summary
Methods Summary
public java.lang.StringgetMechanismType()

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

        Date date = value instanceof Date ? (Date) value :
                ((Calendar) value).getTime();

        // Serialize including convert to GMT
        synchronized (zulu) {
            // Sun JDK bug http://developer.java.sun.com/developer/bugParade/bugs/4229798.html
            return zulu.format(date);
        }
    
public voidserialize(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes, java.lang.Object value, org.apache.axis.encoding.SerializationContext context)
Serialize a Date.

                         //  0123456789 0 123456789

     
        zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
    
        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;