Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc.serializer;
00020
00021 import org.xml.sax.ContentHandler;
00022 import org.xml.sax.SAXException;
00023
00024
00028 public abstract class ExtSerializer implements TypeSerializer {
00031 protected abstract String getTagName();
00034 protected abstract void serialize(ContentHandler pHandler, Object pObject) throws SAXException;
00035
00036 public void write(ContentHandler pHandler, Object pObject)
00037 throws SAXException {
00038 final String tag = getTagName();
00039 final String exTag = "ex:" + getTagName();
00040 pHandler.startElement("", TypeSerializerImpl.VALUE_TAG, TypeSerializerImpl.VALUE_TAG, TypeSerializerImpl.ZERO_ATTRIBUTES);
00041 pHandler.startElement(XmlRpcWriter.EXTENSIONS_URI, tag, exTag, TypeSerializerImpl.ZERO_ATTRIBUTES);
00042 serialize(pHandler, pObject);
00043 pHandler.endElement(XmlRpcWriter.EXTENSIONS_URI, tag, exTag);
00044 pHandler.endElement("", TypeSerializerImpl.VALUE_TAG, TypeSerializerImpl.VALUE_TAG);
00045 }
00046 }