1 7 8 10 package org.jboss.net.jmx.adaptor; 11 12 import org.jboss.axis.encoding.DeserializationContext; 13 import org.jboss.axis.encoding.Deserializer; 14 import org.jboss.axis.encoding.DeserializerImpl; 15 import org.jboss.axis.encoding.DeserializerTarget; 16 import org.jboss.axis.message.SOAPHandler; 17 import org.xml.sax.Attributes ; 18 import org.xml.sax.SAXException ; 19 20 import javax.management.MBeanParameterInfo ; 21 import javax.xml.namespace.QName ; 22 23 31 public class MBeanParameterInfoDeser extends DeserializerImpl 32 { 33 34 private String name; 35 private String type; 36 private String description; 37 38 public void onStartElement(String namespace, String localName, 39 String prefix, Attributes attributes, 40 DeserializationContext context) 41 throws SAXException 42 { 43 44 if (context.isNil(attributes)) 45 { 46 return; 47 } 48 49 51 } 52 53 public SOAPHandler onStartChild(String namespace, 54 String localName, 55 String prefix, 56 Attributes attributes, 57 DeserializationContext context) 58 throws SAXException 59 { 60 61 62 QName itemType = context.getTypeFromAttributes(namespace, 64 localName, 65 attributes); 66 Deserializer dSer = null; 68 if (itemType != null) 69 { 70 dSer = context.getDeserializerForType(itemType); 71 } 72 if (dSer == null) 73 { 74 dSer = new DeserializerImpl(); 75 } 76 77 dSer.registerValueTarget(new DeserializerTarget(this, localName)); 80 81 addChildDeserializer(dSer); 82 83 return (SOAPHandler)dSer; 84 } 85 86 public void setChildValue(Object value, Object hint) throws SAXException 87 { 88 if (hint.equals("name")) 89 name = (String )value; 90 else if (hint.equals("type")) 91 type = (String )value; 92 else if (hint.equals("description")) 93 description = (String )value; 94 95 } 96 97 public void onEndElement(String s, String s1, DeserializationContext deserializationcontext) 98 { 99 try 100 { 101 super.value = new MBeanParameterInfo (name, type, description); 102 } 103 catch (Exception exception) 104 { 105 exception.printStackTrace(); 106 } 107 } 108 109 110 } 111 112 | Popular Tags |