1 8 9 package mx4j.tools.remote.soap.axis.ser; 10 11 import java.io.IOException ; 12 import javax.management.relation.RoleResult ; 13 import javax.xml.namespace.QName ; 14 15 import org.apache.axis.encoding.SerializationContext; 16 import org.apache.axis.wsdl.fromJava.Types; 17 import org.w3c.dom.Element ; 18 import org.xml.sax.Attributes ; 19 20 23 public class RoleResultSer extends AxisSerializer 24 { 25 static final String TYPE = "RoleResult"; 26 static final String ROLE_LIST = "roleList"; 27 static final String ROLE_UNRESOLVED_LIST = "roleUnresolvedList"; 28 protected static final QName ROLE_LIST_QNAME = new QName ("", ROLE_LIST); 29 protected static final QName ROLE_UNRESOLVED_LIST_QNAME = new QName ("", ROLE_UNRESOLVED_LIST); 30 31 public void serialize(QName name, Attributes attributes, Object value, 32 SerializationContext context) 33 throws IOException 34 { 35 RoleResult role = (RoleResult )value; 36 context.startElement(name, attributes); 37 context.serialize(ROLE_LIST_QNAME, null, role.getRoles()); 38 context.serialize(ROLE_UNRESOLVED_LIST_QNAME, null, role.getRolesUnresolved()); 39 context.endElement(); 40 } 41 42 public Element writeSchema(Class aClass, Types types) throws Exception 43 { 44 Element complexType = types.createElement(SCHEMA_COMPLEX_TYPE); 45 complexType.setAttribute("name", TYPE); 46 47 Element roleListElement = types.createElement(SCHEMA_ELEMENT); 48 roleListElement.setAttribute("name", ROLE_LIST); 49 roleListElement.setAttribute("type", RoleListSer.TYPE); 50 complexType.appendChild(roleListElement); 51 52 Element roleUnresolvedListElement = types.createElement(SCHEMA_ELEMENT); 53 roleUnresolvedListElement.setAttribute("name", ROLE_LIST); 54 roleUnresolvedListElement.setAttribute("type", RoleUnresolvedListSer.TYPE); 55 complexType.appendChild(roleUnresolvedListElement); 56 57 return complexType; 58 } 59 60 } 61 | Popular Tags |