1 23 24 package com.sun.enterprise.deployment.node; 25 26 import java.util.ArrayList ; 27 import java.util.HashSet ; 28 import java.util.Iterator ; 29 import java.util.List ; 30 import java.util.logging.Level ; 31 import java.util.Map ; 32 import java.util.Set ; 33 34 import org.xml.sax.Attributes ; 35 import org.w3c.dom.Node ; 36 import org.w3c.dom.Document ; 37 38 import java.io.IOException ; 39 import java.io.InputStream ; 40 41 import com.sun.enterprise.deployment.Descriptor; 42 import com.sun.enterprise.deployment.JaxrpcMappingDescriptor; 43 import com.sun.enterprise.deployment.node.XMLElement; 44 import com.sun.enterprise.deployment.node.BundleNode; 45 import com.sun.enterprise.deployment.node.RootXMLNode; 46 import com.sun.enterprise.deployment.xml.WebServicesTagNames; 47 import com.sun.enterprise.deployment.util.DOLUtils; 48 49 55 public class JaxrpcMappingDescriptorNode extends BundleNode 56 implements RootXMLNode 57 58 { 59 60 public final static XMLElement ROOT_ELEMENT = 61 new XMLElement(WebServicesTagNames.JAXRPC_MAPPING_FILE_ROOT); 62 63 public final static String SCHEMA_ID = "j2ee_jaxrpc_mapping_1_1.xsd"; 64 private static List <String > systemIDs = null; 65 66 private static final Set complexElements; 67 private JaxrpcMappingDescriptor descriptor=null; 68 private String javaPackage=null; 69 70 private boolean complexMapping=false; 72 73 static { 74 complexElements = new HashSet (); 75 complexElements.add(WebServicesTagNames.JAVA_XML_TYPE_MAPPING); 76 complexElements.add(WebServicesTagNames.EXCEPTION_MAPPING); 77 complexElements.add(WebServicesTagNames.SERVICE_INTERFACE_MAPPING); 78 complexElements.add 79 (WebServicesTagNames.SERVICE_ENDPOINT_INTERFACE_MAPPING); 80 } 81 82 public JaxrpcMappingDescriptorNode() { 83 descriptor = new JaxrpcMappingDescriptor(); 84 } 85 86 89 protected XMLElement getXMLRootTag() { 90 return ROOT_ELEMENT; 91 } 92 93 96 public String getDocType() { 97 return null; 98 } 99 100 103 public String getSystemID() { 104 return SCHEMA_ID; 105 } 106 107 110 public List <String > getSystemIDs() { 111 if (systemIDs != null) { 112 return systemIDs; 113 } 114 115 systemIDs = new ArrayList <String >(); 116 systemIDs.add(SCHEMA_ID); 117 return systemIDs; 118 } 119 120 123 protected String getSchemaURL() { 124 return WebServicesTagNames.IBM_NAMESPACE + "/" + getSystemID(); 125 } 126 127 130 public Object getDescriptor() { 131 return descriptor; 132 } 133 134 public void startElement(XMLElement element, Attributes attributes) { 135 if( complexMapping ) { 136 return; 139 } else if( complexElements.contains(element.getQName()) ) { 140 complexMapping = true; 141 descriptor.setIsSimpleMapping(false); 142 } else { 145 super.startElement(element, attributes); 146 } 147 } 148 149 155 public void setElementValue(XMLElement element, String value) { 156 if (complexMapping) { 157 return; 162 } else if(WebServicesTagNames.PACKAGE_TYPE.equals(element.getQName())) { 163 javaPackage = value; 164 } else if(WebServicesTagNames.NAMESPACE_URI.equals(element.getQName())){ 165 descriptor.addMapping(javaPackage, value); 166 javaPackage = null; 167 } else { 168 super.setElementValue(element, value); 169 } 170 } 171 172 175 public String getSpecVersion() { 176 return "1.1"; 177 } 178 179 180 } 181 | Popular Tags |