1 6 7 28 29 package javax.xml.soap; 30 31 import javax.xml.namespace.QName ; 32 33 import org.w3c.dom.Element ; 34 35 50 public abstract class SOAPFactory { 51 52 56 static private final String SOAP_FACTORY_PROPERTY = 57 "javax.xml.soap.SOAPFactory"; 58 59 79 public SOAPElement createElement(Element domElement) throws SOAPException { 80 throw new UnsupportedOperationException ("createElement(org.w3c.dom.Element) must be overridden by all subclasses of SOAPFactory."); 81 } 82 83 101 public abstract SOAPElement createElement(Name name) throws SOAPException ; 102 103 122 public SOAPElement createElement(QName qname) throws SOAPException { 123 throw new UnsupportedOperationException ("createElement(QName) must be overridden by all subclasses of SOAPFactory."); 124 } 125 126 139 public abstract SOAPElement createElement(String localName) 140 throws SOAPException ; 141 142 143 160 public abstract SOAPElement createElement( 161 String localName, 162 String prefix, 163 String uri) 164 throws SOAPException ; 165 166 179 public abstract Detail createDetail() throws SOAPException ; 180 181 190 public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException ; 191 192 198 public abstract SOAPFault createFault() throws SOAPException ; 199 200 215 public abstract Name createName( 216 String localName, 217 String prefix, 218 String uri) 219 throws SOAPException ; 220 221 234 public abstract Name createName(String localName) throws SOAPException ; 235 236 257 public static SOAPFactory newInstance() 258 throws SOAPException 259 { 260 try { 261 SOAPFactory factory = (SOAPFactory ) FactoryFinder.find(SOAP_FACTORY_PROPERTY); 262 if (factory != null) 263 return factory; 264 return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); 265 } catch (Exception ex) { 266 throw new SOAPException ( 267 "Unable to create SOAP Factory: " + ex.getMessage()); 268 } 269 270 } 271 272 291 public static SOAPFactory newInstance(String protocol) 292 throws SOAPException { 293 return SAAJMetaFactory.getInstance().newSOAPFactory(protocol); 294 } 295 } 296 | Popular Tags |