1 16 package org.apache.axis.deployment.wsdd; 17 18 import java.io.IOException ; 19 import javax.xml.namespace.QName ; 20 import org.w3c.dom.Attr ; 21 import org.w3c.dom.Element ; 22 import org.xml.sax.helpers.AttributesImpl ; 23 import org.apache.axis.encoding.SerializationContext; 24 import org.apache.axis.utils.XMLUtils; 25 26 27 37 public class WSDDArrayMapping extends WSDDTypeMapping { 38 39 40 private QName innerType = null; 41 42 45 public WSDDArrayMapping() { 46 } 47 48 public WSDDArrayMapping(Element e) throws WSDDException { 49 super(e); 50 Attr innerTypeAttr = e.getAttributeNode(ATTR_INNER_TYPE); 51 if (innerTypeAttr != null) { 52 String qnameStr = innerTypeAttr.getValue(); 53 innerType = XMLUtils.getQNameFromString(qnameStr, e); 54 } 55 serializer = ARRAY_SERIALIZER_FACTORY; 56 deserializer = ARRAY_DESERIALIZER_FACTORY; 57 } 58 59 protected QName getElementName() { 60 return QNAME_ARRAYMAPPING; 61 } 62 63 66 public QName getInnerType() { 67 return innerType; 68 } 69 70 public void writeToContext(SerializationContext context) throws IOException { 71 AttributesImpl attrs = new AttributesImpl (); 72 73 String typeStr = context.qName2String(typeQName); 74 attrs.addAttribute("", ATTR_LANG_SPEC_TYPE, ATTR_LANG_SPEC_TYPE, "CDATA", typeStr); 75 76 String qnameStr = context.qName2String(qname); 77 attrs.addAttribute("", ATTR_QNAME, ATTR_QNAME, "CDATA", qnameStr); 78 79 String innerTypeStr = context.qName2String(innerType); 80 attrs.addAttribute("", ATTR_INNER_TYPE, ATTR_INNER_TYPE, "CDATA", innerTypeStr); 81 82 context.startElement(QNAME_ARRAYMAPPING, attrs); 83 context.endElement(); 84 } 85 } 86 87 88 89 | Popular Tags |