1 16 package org.apache.axis.deployment.wsdd; 17 18 import org.apache.axis.encoding.SerializationContext; 19 import org.apache.axis.utils.Messages; 20 import org.w3c.dom.Element ; 21 import org.xml.sax.helpers.AttributesImpl ; 22 23 import javax.xml.namespace.QName ; 24 import java.io.IOException ; 25 26 27 30 public class WSDDHandler 31 extends WSDDDeployableItem 32 { 33 36 public WSDDHandler() 37 { 38 } 39 40 45 public WSDDHandler(Element e) 46 throws WSDDException 47 { 48 super(e); 49 if (type == null && (this.getClass() == WSDDHandler.class)) { 50 throw new WSDDException(Messages.getMessage("noTypeAttr00")); 51 } 52 } 53 54 protected QName getElementName() 55 { 56 return QNAME_HANDLER; 57 } 58 59 public void writeToContext(SerializationContext context) 60 throws IOException 61 { 62 AttributesImpl attrs = new AttributesImpl (); 63 QName name = getQName(); 64 if (name != null) { 65 attrs.addAttribute("", ATTR_NAME, ATTR_NAME, 66 "CDATA", context.qName2String(name)); 67 } 68 69 attrs.addAttribute("", ATTR_TYPE, ATTR_TYPE, 70 "CDATA", context.qName2String(getType())); 71 context.startElement(WSDDConstants.QNAME_HANDLER, attrs); 72 writeParamsToContext(context); 73 context.endElement(); 74 } 75 76 public void deployToRegistry(WSDDDeployment deployment) 77 { 78 deployment.addHandler(this); 79 } 80 } 81 | Popular Tags |