Package org.apache.axis2.builder
Class BuilderUtil
- java.lang.Object
-
- org.apache.axis2.builder.BuilderUtil
-
public class BuilderUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
BOM_SIZE
Deprecated.
-
Constructor Summary
Constructors Constructor Description BuilderUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SOAPEnvelope
buildsoapMessage(MessageContext messageContext, MultipleEntryHashMap requestParameterMap, SOAPFactory soapFactory)
static Attachments
createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength)
static Attachments
createAttachmentsMap(MessageContext msgContext, InputStream inStream, String contentTypeString)
static OMXMLParserWrapper
createPOXBuilder(InputStream in, String encoding)
Create a builder suitable for an XML message.static void
createSOAPMessageWithoutSchema(SOAPFactory soapFactory, OMElement bodyFirstChild, MultipleEntryHashMap requestParameterMap)
static SOAPModelBuilder
createSOAPModelBuilder(InputStream in, String encoding)
Create a SOAP model builder.static Builder
getBuilderFromSelector(String type, MessageContext msgContext)
Deprecated.static String
getCharSetEncoding(PushbackInputStream is2, String defaultEncoding)
Deprecated.It's the role of the XML parser to determine the charset encoding and/or byte order using the algorithm described in the "Autodetection of Character Encodings" appendix of the XML spec.static String
getCharSetEncoding(String contentType)
Extracts and returns the character set encoding from the Content-type headerstatic String
getEnvelopeNamespace(String contentType)
static PushbackInputStream
getPushbackInputStream(InputStream is)
Deprecated.If you need aPushbackInputStream
just construct one (with the appropriate size).static Reader
getReader(InputStream is, String charSetEncoding)
Deprecated.Instead of using this method, you should probably pass theInputStream
directly to the XML parser.static boolean
isAttachmentsCacheEnabled(MessageContext msgContext)
static void
validateCharSetEncoding(String charsetEncodingFromTransport, String charsetEncodingFromXML, String soapNamespaceURI)
static void
validateSOAPVersion(String soapNamespaceURIFromTransport, SOAPEnvelope envelope)
-
-
-
Field Detail
-
BOM_SIZE
public static final int BOM_SIZE
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
buildsoapMessage
public static SOAPEnvelope buildsoapMessage(MessageContext messageContext, MultipleEntryHashMap requestParameterMap, SOAPFactory soapFactory) throws AxisFault
- Throws:
AxisFault
-
createSOAPMessageWithoutSchema
public static void createSOAPMessageWithoutSchema(SOAPFactory soapFactory, OMElement bodyFirstChild, MultipleEntryHashMap requestParameterMap)
-
createPOXBuilder
public static OMXMLParserWrapper createPOXBuilder(InputStream in, String encoding)
Create a builder suitable for an XML message. This method usesStAXParserConfiguration.SOAP
to disallow document type declarations (that potentially reference external entities).- Parameters:
in
- the input stream containing the plain XML messageencoding
- the charset encoding of the message ornull
if the parser should determine the charset encoding- Returns:
- the builder
-
getReader
public static Reader getReader(InputStream is, String charSetEncoding) throws IOException
Deprecated.Instead of using this method, you should probably pass theInputStream
directly to the XML parser. If the stream is not XML, you shouldn't be using this method anyway.- Throws:
IOException
-
getPushbackInputStream
public static PushbackInputStream getPushbackInputStream(InputStream is)
Deprecated.If you need aPushbackInputStream
just construct one (with the appropriate size).
-
getCharSetEncoding
public static String getCharSetEncoding(PushbackInputStream is2, String defaultEncoding) throws IOException
Deprecated.It's the role of the XML parser to determine the charset encoding and/or byte order using the algorithm described in the "Autodetection of Character Encodings" appendix of the XML spec. If you need this method, then something is wrong: probably you are using aReader
where you should use anInputStream
.- Throws:
IOException
-
getCharSetEncoding
public static String getCharSetEncoding(String contentType)
Extracts and returns the character set encoding from the Content-type header Example: "Content-Type: text/xml; charset=utf-8" would return "utf-8"- Parameters:
contentType
- a content-type (from HTTP or MIME, for instance)- Returns:
- the character set encoding if found, or MessageContext.DEFAULT_CHAR_SET_ENCODING
-
createAttachmentsMap
public static Attachments createAttachmentsMap(MessageContext msgContext, InputStream inStream, String contentTypeString)
-
isAttachmentsCacheEnabled
public static boolean isAttachmentsCacheEnabled(MessageContext msgContext)
-
createAttachments
public static Attachments createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength)
-
createSOAPModelBuilder
public static SOAPModelBuilder createSOAPModelBuilder(InputStream in, String encoding)
Create a SOAP model builder. This method delegates toOMXMLBuilderFactory.createSOAPModelBuilder(InputStream, String)
but generates additional logging if an error occurs.- Parameters:
in
- the input stream containing the SOAP messageencoding
- the charset encoding of the SOAP message ornull
if the parser should determine the charset encoding- Returns:
- the builder
-
getBuilderFromSelector
public static Builder getBuilderFromSelector(String type, MessageContext msgContext) throws AxisFault
Deprecated.- Throws:
AxisFault
-
validateSOAPVersion
public static void validateSOAPVersion(String soapNamespaceURIFromTransport, SOAPEnvelope envelope)
-
-