1 7 8 10 package org.jboss.net.jmx.adaptor; 11 12 import org.jboss.axis.encoding.SerializationContext; 13 import org.jboss.axis.encoding.ser.SimpleSerializer; 14 import org.jboss.axis.wsdl.fromJava.Types; 15 import org.w3c.dom.Element ; 16 17 import javax.management.ObjectName ; 18 import javax.xml.namespace.QName ; 19 20 28 29 public class ObjectNameSer extends SimpleSerializer 30 { 31 32 public ObjectNameSer(Class javaType, QName xmlType) 33 { 34 super(javaType, xmlType); 35 } 36 37 public String getValueAsString(Object value, SerializationContext context) 38 { 39 return ((ObjectName )value).getCanonicalName(); 40 } 41 42 45 public Element writeSchema(Class clazz, Types types) throws Exception 46 { 47 Element complexType = types.createElement("complexType"); 49 types.writeSchemaElement(xmlType, complexType); 51 complexType.setAttribute("name", xmlType.getLocalPart()); 52 53 Element simpleContent = types.createElement("simpleContent"); 55 complexType.appendChild(simpleContent); 56 Element extension = types.createElement("extension"); 57 simpleContent.appendChild(extension); 58 59 String base = "string"; 61 extension.setAttribute("base", base); 62 return complexType; 64 } 65 66 } | Popular Tags |