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.MBeanAttributeInfo ; 21 import javax.xml.namespace.QName ; 22 23 31 public class MBeanAttributeInfoDeser extends DeserializerImpl 32 { 33 34 private String name; 35 private String type; 36 private String description; 37 private boolean isReadable; 38 private boolean isWritable; 39 private boolean isIs; 40 41 public void onStartElement(String namespace, 42 String localName, 43 String prefix, 44 Attributes attributes, 45 DeserializationContext context) 46 throws SAXException 47 { 48 49 if (context.isNil(attributes)) 50 { 51 return; 52 } 53 54 56 } 57 58 public SOAPHandler onStartChild(String namespace, 59 String localName, 60 String prefix, 61 Attributes attributes, 62 DeserializationContext context) 63 throws SAXException 64 { 65 66 QName itemType = 68 context.getTypeFromAttributes(namespace, localName, attributes); 69 Deserializer dSer = null; 71 if (itemType != null) 72 { 73 dSer = context.getDeserializerForType(itemType); 74 } 75 if (dSer == null) 76 { 77 dSer = new DeserializerImpl(); 78 } 79 80 dSer.registerValueTarget(new DeserializerTarget(this, localName)); 83 84 addChildDeserializer(dSer); 85 86 return (SOAPHandler)dSer; 87 } 88 89 public void setChildValue(Object value, Object hint) throws SAXException 90 { 91 if (hint.equals("name")) 92 name = (String )value; 93 else if (hint.equals("type")) 94 type = (String )value; 95 else if (hint.equals("description")) 96 description = (String )value; 97 else if (hint.equals("isReadable")) 98 isReadable = ((Boolean )value).booleanValue(); 99 else if (hint.equals("isWritable")) 100 isWritable = ((Boolean )value).booleanValue(); 101 else if (hint.equals("isIs")) 102 isIs = ((Boolean )value).booleanValue(); 103 104 } 105 106 public void onEndElement(String s, 107 String s1, 108 DeserializationContext deserializationcontext) 109 { 110 try 111 { 112 super.value = 113 new MBeanAttributeInfo (name, 114 type, 115 description, 116 isReadable, 117 isWritable, 118 isIs); 119 } 120 catch (Exception exception) 121 { 122 exception.printStackTrace(); 123 } 124 } 125 126 } 127 | Popular Tags |