01: package tableapp.business.axis;
02:
03: /**
04: * <p>Title: </p>
05: * <p>Description: </p>
06: * <p>Copyright: Copyright (c) 2005</p>
07: * <p>Company: </p>
08: * @author not attributable
09: * @version 1.0
10: */
11: import org.apache.axis.Constants;
12: import org.apache.axis.encoding.SerializationContext;
13: import org.apache.axis.encoding.Serializer;
14: import org.apache.axis.wsdl.fromJava.Types;
15: import org.w3c.dom.Element;
16: import org.xml.sax.Attributes;
17: import java.util.Date;
18: import javax.xml.namespace.QName;
19: import java.io.IOException;
20: import tableapp.spec.Access;
21:
22: public class AccessSer implements Serializer {
23: public static final String INTMEMBER = "noAccesses";
24: public static final String DATEMEMBER = "sDate";
25: public static final QName myTypeQName = new QName("typeNS",
26: "Access");
27:
28: public void serialize(QName name, Attributes attributes,
29: Object value, SerializationContext context)
30: throws IOException {
31: if (!(value instanceof Access))
32: throw new IOException("Can't serialize a "
33: + value.getClass().getName() + " with a AccessSer.");
34: Access data = (Access) value;
35:
36: context.startElement(name, attributes);
37: context.serialize(new QName("", INTMEMBER), null, new Integer(
38: data.getNoAccesses()));
39: context.serialize(new QName("", DATEMEMBER), null, data
40: .getDate());
41: context.endElement();
42: }
43:
44: public String getMechanismType() {
45: return Constants.AXIS_SAX;
46: }
47:
48: public Element writeSchema(Class javaType, Types types)
49: throws Exception {
50: return null;
51: }
52:
53: }
|