1 package de.timroes.axmlrpc.serializer; 2 3 import de.timroes.axmlrpc.XMLRPCException; 4 import de.timroes.axmlrpc.XMLUtil; 5 import de.timroes.axmlrpc.xmlcreator.XmlElement; 6 import org.w3c.dom.Element; 7 8 /** 9 * 10 * @author timroes 11 */ 12 public class IntSerializer implements Serializer { 13 deserialize(Element content)14 public Object deserialize(Element content) throws XMLRPCException { 15 return Integer.parseInt(XMLUtil.getOnlyTextContent(content.getChildNodes())); 16 } 17 serialize(Object object)18 public XmlElement serialize(Object object) { 19 return XMLUtil.makeXmlTag(SerializerHandler.TYPE_INT, 20 object.toString()); 21 } 22 23 } 24