DateSerializerpublic class DateSerializer extends Object implements org.apache.axis.encoding.SimpleValueSerializer
Fields Summary |
---|
private static SimpleDateFormat | zulu | private static Calendar | calendar |
Methods Summary |
---|
public java.lang.String | getMechanismType() return Constants.AXIS_SAX;
| public java.lang.String | getValueAsString(java.lang.Object value, org.apache.axis.encoding.SerializationContext context)
StringBuffer buf = new StringBuffer();
synchronized (calendar) {
if(value instanceof Calendar) {
value = ((Calendar)value).getTime();
}
if (calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
buf.append("-");
calendar.setTime((Date)value);
calendar.set(Calendar.ERA, GregorianCalendar.AD);
value = calendar.getTime();
}
buf.append(zulu.format((Date)value));
}
return buf.toString();
| public void | serialize(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes, java.lang.Object value, org.apache.axis.encoding.SerializationContext context)Serialize a Date.
context.startElement(name, attributes);
context.writeString(getValueAsString(value, context));
context.endElement();
| public org.w3c.dom.Element | writeSchema(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.
return null;
|
|