package org.jboss.net.jmx.adaptor;
import org.jboss.axis.encoding.SerializationContext;
import org.jboss.axis.encoding.ser.SimpleSerializer;
import org.jboss.axis.wsdl.fromJava.Types;
import org.w3c.dom.Element;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
public class ObjectNameSer extends SimpleSerializer
{
public ObjectNameSer(Class javaType, QName xmlType)
{
super(javaType, xmlType);
}
public String getValueAsString(Object value, SerializationContext context)
{
return ((ObjectName)value).getCanonicalName();
}
public Element writeSchema(Class clazz, Types types) throws Exception
{
Element complexType = types.createElement("complexType");
types.writeSchemaElement(xmlType, complexType);
complexType.setAttribute("name", xmlType.getLocalPart());
Element simpleContent = types.createElement("simpleContent");
complexType.appendChild(simpleContent);
Element extension = types.createElement("extension");
simpleContent.appendChild(extension);
String base = "string";
extension.setAttribute("base", base);
return complexType;
}
}