Skip to content

Package: SAAJMetaFactoryImpl

SAAJMetaFactoryImpl

nameinstructionbranchcomplexitylinemethod
SAAJMetaFactoryImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
newMessageFactory(String)
M: 0 C: 47
100%
M: 0 C: 6
100%
M: 0 C: 4
100%
M: 0 C: 9
100%
M: 0 C: 1
100%
newSOAPFactory(String)
M: 0 C: 47
100%
M: 0 C: 6
100%
M: 0 C: 4
100%
M: 0 C: 9
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Distribution License v. 1.0, which is available at
6: * http://www.eclipse.org/org/documents/edl-v10.php.
7: *
8: * SPDX-License-Identifier: BSD-3-Clause
9: */
10:
11: package com.sun.xml.messaging.saaj.soap;
12:
13: import jakarta.xml.soap.SAAJMetaFactory;
14: import jakarta.xml.soap.SOAPConstants;
15: import jakarta.xml.soap.MessageFactory;
16: import jakarta.xml.soap.SOAPFactory;
17: import jakarta.xml.soap.SOAPException;
18:
19: import java.util.logging.Level;
20: import java.util.logging.Logger;
21:
22: import com.sun.xml.messaging.saaj.util.LogDomainConstants;
23:
24: public class SAAJMetaFactoryImpl extends SAAJMetaFactory {
25:
26: private static final Logger log =
27: Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
28: "com.sun.xml.messaging.saaj.soap.LocalStrings");
29:
30: public SAAJMetaFactoryImpl() {
31: }
32:
33: @Override
34: protected MessageFactory newMessageFactory(String protocol)
35: throws SOAPException {
36:• if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
37: return new com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
38:• } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
39: return new com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
40:• } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
41: return new com.sun.xml.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
42: } else {
43: log.log(
44: Level.SEVERE,
45: "SAAJ0569.soap.unknown.protocol",
46: new Object[] {protocol.replaceAll("[\r\n]",""), "MessageFactory"});
47: throw new SOAPException("Unknown Protocol: " + protocol +
48: " specified for creating MessageFactory");
49: }
50: }
51:
52: @Override
53: protected SOAPFactory newSOAPFactory(String protocol)
54: throws SOAPException {
55:• if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
56: return new com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl();
57:• } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
58: return new com.sun.xml.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl();
59:• } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
60: return new com.sun.xml.messaging.saaj.soap.dynamic.SOAPFactoryDynamicImpl();
61: } else {
62: log.log(
63: Level.SEVERE,
64: "SAAJ0569.soap.unknown.protocol",
65: new Object[] {protocol.replaceAll("[\r\n]",""), "SOAPFactory"});
66: throw new SOAPException("Unknown Protocol: " + protocol +
67: " specified for creating SOAPFactory");
68: }
69: }
70:
71: }