pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/apache/axis-axis2-java-core/commit/7d96a527a8ad12bca6d984ba2e9b69d0cfe5a37a

ous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-9c8f61f9f58ad7b2.css" /> Remove references to Axiom implementation classes. · apache/axis-axis2-java-core@7d96a52 · GitHub
Skip to content

Commit 7d96a52

Browse files
committed
Remove references to Axiom implementation classes.
1 parent a1bfab5 commit 7d96a52

13 files changed

Lines changed: 47 additions & 304 deletions

File tree

modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import javax.xml.stream.XMLStreamReader;
5656

5757
import org.apache.axiom.om.*;
58-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
5958
import org.apache.axiom.util.base64.Base64Utils;
6059
import org.apache.axis2.AxisFault;
6160
import org.apache.axis2.classloader.BeanInfoCache;
@@ -1510,10 +1509,9 @@ public static List<OMElement> getMapElement(OMFactory fac, Type type,
15101509
entryQName, properties.toArray(), null,
15111510
typeTable, elementFormDefault);
15121511

1513-
StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(
1514-
OMAbstractFactory.getOMFactory(), new StreamWrapper(
1515-
pullParser));
1516-
omEntry = stAXOMBuilder.getDocumentElement();
1512+
OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(
1513+
new StreamWrapper(pullParser));
1514+
omEntry = builder.getDocumentElement();
15171515
list.add(omEntry);
15181516
}
15191517
}
@@ -1823,9 +1821,9 @@ public static OMElement getCollectionElement(OMFactory fac, Type type,
18231821
XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(eleQName, properties.toArray(), null, typeTable,
18241822
elementFormDefault);
18251823

1826-
StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(
1827-
OMAbstractFactory.getOMFactory(), new StreamWrapper(pullParser));
1828-
return stAXOMBuilder.getDocumentElement();
1824+
OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(
1825+
new StreamWrapper(pullParser));
1826+
return builder.getDocumentElement();
18291827
}
18301828

18311829
/**

modules/adb/src/org/apache/axis2/databinding/utils/MultirefHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.axiom.om.OMFactory;
2626
import org.apache.axiom.om.OMNode;
2727
import org.apache.axiom.om.OMText;
28-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
28+
import org.apache.axiom.om.OMXMLBuilderFactory;
2929
import org.apache.axiom.soap.SOAPBody;
3030
import org.apache.axiom.soap.SOAPEnvelope;
3131
import org.apache.axis2.AxisFault;
@@ -105,7 +105,7 @@ public OMElement processElementforRefs(OMElement elemnts) throws AxisFault {
105105
}
106106

107107
private OMElement elementClone(OMElement ele) {
108-
return new StAXOMBuilder(ele.getXMLStreamReader()).getDocumentElement();
108+
return OMXMLBuilderFactory.createStAXOMBuilder(ele.getXMLStreamReader()).getDocumentElement();
109109
}
110110

111111
public Object processRef(Class javatype, String id,

modules/adb/src/org/apache/axis2/databinding/utils/NamedStaxOMBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
package org.apache.axis2.databinding.utils;
2121

2222
import org.apache.axiom.om.OMElement;
23-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
23+
import org.apache.axiom.om.OMXMLBuilderFactory;
24+
import org.apache.axiom.om.OMXMLParserWrapper;
2425

2526
import javax.xml.namespace.QName;
2627
import javax.xml.stream.XMLStreamConstants;
2728
import javax.xml.stream.XMLStreamReader;
2829

2930
public class NamedStaxOMBuilder {
3031

31-
//wrap a StAXOMBuilder
32-
private StAXOMBuilder builder;
32+
//wrap an OMXMLParserWrapper
33+
private OMXMLParserWrapper builder;
3334
private XMLStreamReader reader;
3435
private QName nameToMatch;
3536

@@ -39,7 +40,7 @@ public class NamedStaxOMBuilder {
3940
*/
4041
public NamedStaxOMBuilder(XMLStreamReader xmlStreamReader, QName nameToMatch) {
4142
reader = xmlStreamReader;
42-
builder = new StAXOMBuilder(xmlStreamReader);
43+
builder = OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader);
4344
this.nameToMatch = nameToMatch;
4445
}
4546

modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
import org.apache.axiom.om.OMElement;
2727
import org.apache.axiom.om.OMNamespace;
28-
import org.apache.axiom.om.OMAbstractFactory;
29-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
28+
import org.apache.axiom.om.OMXMLBuilderFactory;
29+
import org.apache.axiom.om.OMXMLParserWrapper;
3030
import org.apache.axiom.soap.SOAPBody;
3131
import org.apache.axiom.soap.SOAPEnvelope;
3232
import org.apache.axiom.soap.SOAPFactory;
@@ -201,8 +201,8 @@ public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMess
201201
QName innerElementQName = new QName(elementQName.getNamespaceURI(), getSimpleClassName(exceptionType));
202202
XMLStreamReader xr = BeanUtil.getPullParser(cause,
203203
innerElementQName, typeTable, true, false);
204-
StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(), new StreamWrapper(xr));
205-
OMElement documentElement = stAXOMBuilder.getDocumentElement();
204+
OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(new StreamWrapper(xr));
205+
OMElement documentElement = builder.getDocumentElement();
206206
exceptionElement.addChild(documentElement);
207207
}
208208
}

modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
import org.apache.axiom.om.OMText;
3030
import org.apache.axiom.om.OMXMLBuilderFactory;
3131
import org.apache.axiom.om.OMXMLParserWrapper;
32-
import org.apache.axiom.om.impl.builder.StAXBuilder;
33-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
3432
import org.apache.axiom.om.util.StAXParserConfiguration;
35-
import org.apache.axiom.om.util.StAXUtils;
3633
import org.apache.axiom.soap.SOAP11Constants;
3734
import org.apache.axiom.soap.SOAP12Constants;
3835
import org.apache.axiom.soap.SOAPBody;
@@ -41,7 +38,6 @@
4138
import org.apache.axiom.soap.SOAPFactory;
4239
import org.apache.axiom.soap.SOAPModelBuilder;
4340
import org.apache.axiom.soap.SOAPProcessingException;
44-
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
4541
import org.apache.axis2.AxisFault;
4642
import org.apache.axis2.Constants;
4743
import org.apache.axis2.context.MessageContext;
@@ -62,8 +58,6 @@
6258

6359
import javax.activation.DataHandler;
6460
import javax.xml.namespace.QName;
65-
import javax.xml.stream.XMLStreamException;
66-
import javax.xml.stream.XMLStreamReader;
6761
import java.io.BufferedReader;
6862
import java.io.IOException;
6963
import java.io.InputStream;
@@ -258,22 +252,6 @@ private static void addRequestParameter(SOAPFactory soapFactory,
258252
}
259253
}
260254

261-
/**
262-
* @deprecated Please use {@link #createPOXBuilder(InputStream, String)} to enable usage of non
263-
* standard Axiom implementations.
264-
*/
265-
public static StAXBuilder getPOXBuilder(InputStream inStream, String charSetEnc)
266-
throws XMLStreamException {
267-
StAXBuilder builder;
268-
// We use the StAXParserConfiguration.SOAP here as well because we don't want to allow
269-
// document type declarations (that potentially reference external entities), even
270-
// in plain XML messages.
271-
XMLStreamReader xmlreader =
272-
StAXUtils.createXMLStreamReader(StAXParserConfiguration.SOAP, inStream, charSetEnc);
273-
builder = new StAXOMBuilder(xmlreader);
274-
return builder;
275-
}
276-
277255
/**
278256
* Create a builder suitable for an XML message. This method uses
279257
* {@link StAXParserConfiguration#SOAP} to disallow document type declarations (that potentially
@@ -574,27 +552,6 @@ public static Attachments createAttachments(MessageContext msgContext,
574552
contentLength);
575553
}
576554

577-
/**
578-
* Utility method to get a StAXBuilder
579-
*
580-
* @param in an InputStream
581-
* @return a StAXSOAPModelBuilder for the given InputStream
582-
* @throws XMLStreamException
583-
* @deprecated If some one really need this method, please shout.
584-
*/
585-
public static StAXBuilder getBuilder(Reader in) throws XMLStreamException {
586-
XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in);
587-
return new StAXSOAPModelBuilder(xmlreader, null);
588-
}
589-
590-
/**
591-
* @deprecated Please use {@link OMXMLBuilderFactory#createOMBuilder(InputStream)} instead.
592-
*/
593-
public static StAXBuilder getBuilder(InputStream inStream) throws XMLStreamException {
594-
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(inStream);
595-
return new StAXOMBuilder(xmlReader);
596-
}
597-
598555
/**
599556
* Create a SOAP model builder. This method delegates to
600557
* {@link OMXMLBuilderFactory#createSOAPModelBuilder(InputStream, String)} but generates
@@ -622,76 +579,6 @@ public static SOAPModelBuilder createSOAPModelBuilder(InputStream in, String enc
622579
}
623580
}
624581

625-
/**
626-
* @deprecated Please use {@link #createSOAPModelBuilder(InputStream, String)} to enable usage
627-
* of non standard Axiom implementations.
628-
*/
629-
public static StAXBuilder getBuilder(InputStream inStream, String charSetEnc)
630-
throws XMLStreamException {
631-
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(inStream, charSetEnc);
632-
try {
633-
return new StAXSOAPModelBuilder(xmlReader);
634-
} catch (OMException e) {
635-
log.info("OMException in getSOAPBuilder", e);
636-
try {
637-
log.info("Remaining input stream :[" +
638-
new String(IOUtils.toByteArray(inStream), charSetEnc) + "]");
639-
} catch (IOException e1) {
640-
// Nothing here?
641-
}
642-
throw e;
643-
}
644-
}
645-
646-
/**
647-
* @deprecated Please use {@link #createSOAPModelBuilder(InputStream, String)} to enable usage
648-
* of non standard Axiom implementations.
649-
*/
650-
public static StAXBuilder getSOAPBuilder(InputStream inStream) throws XMLStreamException {
651-
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(inStream);
652-
try {
653-
return new StAXSOAPModelBuilder(xmlReader);
654-
} catch (OMException e) {
655-
log.info("OMException in getSOAPBuilder", e);
656-
try {
657-
log.info("Remaining input stream :[" +
658-
new String(IOUtils.toByteArray(inStream)) + "]");
659-
} catch (IOException e1) {
660-
// Nothing here?
661-
}
662-
throw e;
663-
}
664-
}
665-
666-
/**
667-
* @deprecated Please use {@link #createSOAPModelBuilder(InputStream, String)} to enable usage
668-
* of non standard Axiom implementations.
669-
*/
670-
public static StAXBuilder getSOAPBuilder(InputStream inStream, String charSetEnc)
671-
throws XMLStreamException {
672-
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(inStream, charSetEnc);
673-
try {
674-
return new StAXSOAPModelBuilder(xmlReader);
675-
} catch (OMException e) {
676-
log.info("OMException in getSOAPBuilder", e);
677-
try {
678-
log.info("Remaining input stream :[" +
679-
new String(IOUtils.toByteArray(inStream), charSetEnc) + "]");
680-
} catch (IOException e1) {
681-
// Nothing here?
682-
}
683-
throw e;
684-
}
685-
}
686-
687-
public static StAXBuilder getBuilder(SOAPFactory soapFactory, InputStream in, String charSetEnc)
688-
throws XMLStreamException {
689-
StAXBuilder builder;
690-
XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in, charSetEnc);
691-
builder = new StAXOMBuilder(soapFactory, xmlreader);
692-
return builder;
693-
}
694-
695582
/**
696583
* Initial work for a builder selector which selects the builder for a given message format
697584
* based on the the content type of the recieved message. content-type to builder mapping can be

modules/kernel/src/org/apache/axis2/context/externalize/MessageExternalizeUtils.java

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
import org.apache.axiom.om.OMXMLBuilderFactory;
2626
import org.apache.axiom.om.OMXMLParserWrapper;
2727
import org.apache.axiom.om.impl.MTOMConstants;
28-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
2928
import org.apache.axiom.om.util.StAXParserConfiguration;
30-
import org.apache.axiom.om.util.StAXUtils;
3129
import org.apache.axiom.soap.SOAPEnvelope;
32-
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
3330
import org.apache.axis2.AxisFault;
3431
import org.apache.axis2.Constants;
3532
import org.apache.axis2.builder.BuilderUtil;
@@ -48,7 +45,6 @@
4845

4946
import javax.xml.parsers.FactoryConfigurationError;
5047
import javax.xml.stream.XMLStreamException;
51-
import javax.xml.stream.XMLStreamReader;
5248

5349
/**
5450
* Utility to read/write the Message of a MessageContext
@@ -185,9 +181,6 @@ private static OMXMLParserWrapper getAttachmentsBuilder(MessageContext msgContex
185181
InputStream inStream, String contentTypeString,
186182
boolean isSOAP)
187183
throws OMException, XMLStreamException, FactoryConfigurationError {
188-
OMXMLParserWrapper builder = null;
189-
XMLStreamReader streamReader;
190-
191184
Attachments attachments = BuilderUtil.createAttachmentsMap(msgContext, inStream, contentTypeString);
192185
String charSetEncoding = BuilderUtil.getCharSetEncoding(attachments.getRootPartContentType());
193186

@@ -198,41 +191,26 @@ private static OMXMLParserWrapper getAttachmentsBuilder(MessageContext msgContex
198191
msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
199192
charSetEncoding);
200193

201-
streamReader = StAXUtils.createXMLStreamReader(attachments.getRootPartInputStream(), charSetEncoding);
202-
203194
// Setting the Attachments map to new SwA API
204195
msgContext.setAttachmentMap(attachments);
205196

206-
String soapEnvelopeNamespaceURI = BuilderUtil.getEnvelopeNamespace(contentTypeString);
207-
208197
if (isSOAP) {
209198
if (attachments.getAttachmentSpecType().equals(
210199
MTOMConstants.MTOM_TYPE)) {
211-
builder = OMXMLBuilderFactory.createSOAPModelBuilder(attachments);
212-
} else if (attachments.getAttachmentSpecType().equals(
213-
MTOMConstants.SWA_TYPE)) {
214-
builder = new StAXSOAPModelBuilder(streamReader,
215-
soapEnvelopeNamespaceURI);
216-
} else if (attachments.getAttachmentSpecType().equals(
217-
MTOMConstants.SWA_TYPE_12)) {
218-
builder = new StAXSOAPModelBuilder(streamReader,
219-
soapEnvelopeNamespaceURI);
200+
return OMXMLBuilderFactory.createSOAPModelBuilder(attachments);
201+
} else {
202+
return OMXMLBuilderFactory.createSOAPModelBuilder(attachments.getRootPartInputStream(), charSetEncoding);
220203
}
221204

222205
}
223206
// To handle REST XOP case
224207
else {
225208
if (attachments.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)) {
226-
builder = OMXMLBuilderFactory.createOMBuilder(StAXParserConfiguration.DEFAULT, attachments);
227-
228-
} else if (attachments.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE)) {
229-
builder = new StAXOMBuilder(streamReader);
230-
} else if (attachments.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE_12)) {
231-
builder = new StAXOMBuilder(streamReader);
209+
return OMXMLBuilderFactory.createOMBuilder(StAXParserConfiguration.DEFAULT, attachments);
210+
} else {
211+
return OMXMLBuilderFactory.createOMBuilder(attachments.getRootPartInputStream(), charSetEncoding);
232212
}
233213
}
234-
235-
return builder;
236214
}
237215

238216
/**

modules/metadata/src/org/apache/axis2/jaxws/util/SoapUtils.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,15 @@
2121

2222
import org.apache.axiom.om.OMAbstractFactory;
2323
import org.apache.axiom.om.OMElement;
24-
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
24+
import org.apache.axiom.om.OMXMLBuilderFactory;
2525
import org.apache.axiom.soap.SOAPEnvelope;
2626
import org.apache.axiom.soap.SOAPFactory;
2727

28-
import javax.xml.stream.XMLStreamReader;
29-
3028
public class SoapUtils {
3129

3230

3331
public static OMElement getOMElement(SOAPEnvelope response) {
34-
XMLStreamReader parser = response.getXMLStreamReader();
35-
36-
StAXOMBuilder builder =
37-
new StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);
38-
39-
return builder.getDocumentElement();
40-
32+
return OMXMLBuilderFactory.createStAXOMBuilder(response.getXMLStreamReader()).getDocumentElement();
4133
}
4234

4335
public static SOAPFactory getSoapFactory(String soapVersionURI) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy