Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.axis2.builder
Class BuilderUtil

    java.lang.Object
      org.apache.axis2.builder.BuilderUtil

    public class BuilderUtil

extends Object

Field Summary
`static int` | `BOM_SIZE`

Constructor Summary
`BuilderUtil()`

Method Summary
`static org.apache.axiom.soap.SOAPEnvelope` | `buildsoapMessage(MessageContext messageContext, MultipleEntryHashMap requestParameterMap, org.apache.axiom.soap.SOAPFactory soapFactory)`
`static org.apache.axiom.attachments.Attachments` | `createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength)`
`protected static org.apache.axiom.attachments.Attachments` | `createAttachmentsMap(MessageContext msgContext, InputStream inStream, String contentTypeString)`
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getAttachmentsBuilder(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean isSOAP)`
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getBuilder(InputStream inStream)` Creates an OMBuilder for a plain XML message.
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getBuilder(InputStream inStream, String charSetEnc)` Creates an OMBuilder for a plain XML message.
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getBuilder(Reader in)` Deprecated. If some one really need this method, please shout.
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getBuilder(org.apache.axiom.soap.SOAPFactory soapFactory, InputStream in, String charSetEnc)`
`static Builder` | `getBuilderFromSelector(String type, MessageContext msgContext)` Initial work for a builder selector which selects the builder for a given message format based on the the content type of the recieved message.
`static String` | `getCharSetEncoding(PushbackInputStream is2, String defaultEncoding)` Use the BOM Mark to identify the encoding to be used.
`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"
`static String` | `getEnvelopeNamespace(String contentType)`
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getPOXBuilder(InputStream inStream, String charSetEnc)`
`static PushbackInputStream` | `getPushbackInputStream(InputStream is)` Convenience method to get a PushbackInputStream so that we can read the BOM
`static Reader` | `getReader(InputStream is, String charSetEncoding)` Use the BOM Mark to identify the encoding to be used.
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getSOAPBuilder(InputStream inStream)` Creates an OMBuilder for a SOAP message.
`static org.apache.axiom.om.impl.builder.StAXBuilder` | `getSOAPBuilder(InputStream inStream, String charSetEnc)` Creates an OMBuilder for a SOAP message.
`static boolean` | `isAttachmentsCacheEnabled(MessageContext msgContext)`
`static void` | `validateCharSetEncoding(String charsetEncodingFromTransport, String charsetEncodingFromXML, String soapNamespaceURI)`
`static void` | `validateSOAPVersion(String soapNamespaceURIFromTransport, org.apache.axiom.soap.SOAPEnvelope envelope)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BOM_SIZE

    public static final int BOM_SIZE

See Also:
  Constant Field Values

Constructor Detail

### BuilderUtil

    public BuilderUtil()

Method Detail

### buildsoapMessage

    public static org.apache.axiom.soap.SOAPEnvelope buildsoapMessage(MessageContext messageContext,
                                                                      MultipleEntryHashMap requestParameterMap,
                                                                      org.apache.axiom.soap.SOAPFactory soapFactory)
                                                               throws AxisFault

  Throws:
    `AxisFault`

### getPOXBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getPOXBuilder(InputStream inStream,
                                                                             String charSetEnc)
                                                                      throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### getReader

    public static Reader getReader(InputStream is,
                                   String charSetEncoding)
                            throws IOException

  Use the BOM Mark to identify the encoding to be used. Fall back to default encoding specified

  Parameters:
    `is` - the InputStream of a message
    `charSetEncoding` - default character set encoding
  Returns:
    a Reader with the correct encoding already set
  Throws:
    `IOException`

### getPushbackInputStream

    public static PushbackInputStream getPushbackInputStream(InputStream is)

  Convenience method to get a PushbackInputStream so that we can read the BOM

  Parameters:
    `is` - a regular InputStream
  Returns:
    a PushbackInputStream wrapping the passed one

### getCharSetEncoding

    public static String getCharSetEncoding(PushbackInputStream is2,
                                            String defaultEncoding)
                                     throws IOException

  Use the BOM Mark to identify the encoding to be used. Fall back to default encoding specified

  Parameters:
    `is2` - PushBackInputStream (it must be a pushback input stream so that we can unread the BOM)
    `defaultEncoding` - default encoding style if no BOM
  Returns:
    the selected character set encoding
  Throws:
    `IOException`

### getEnvelopeNamespace

    public static String getEnvelopeNamespace(String contentType)

### 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

### getAttachmentsBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getAttachmentsBuilder(MessageContext msgContext,
                                                                                     InputStream inStream,
                                                                                     String contentTypeString,
                                                                                     boolean isSOAP)
                                                                              throws org.apache.axiom.om.OMException,
                                                                                     javax.xml.stream.XMLStreamException,
                                                                                     FactoryConfigurationError

  Throws:
    `org.apache.axiom.om.OMException`
    `javax.xml.stream.XMLStreamException`
    `FactoryConfigurationError`

### createAttachmentsMap

    protected static org.apache.axiom.attachments.Attachments createAttachmentsMap(MessageContext msgContext,
                                                                                   InputStream inStream,
                                                                                   String contentTypeString)

### isAttachmentsCacheEnabled

    public static boolean isAttachmentsCacheEnabled(MessageContext msgContext)

### createAttachments

    public static org.apache.axiom.attachments.Attachments createAttachments(MessageContext msgContext,
                                                                             InputStream inStream,
                                                                             String contentTypeString,
                                                                             boolean fileCacheForAttachments,
                                                                             String attachmentRepoDir,
                                                                             String attachmentSizeThreshold,
                                                                             int contentLength)

### getBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getBuilder(Reader in)
                                                                   throws javax.xml.stream.XMLStreamException

  Deprecated. If some one really need this method, please shout.

  Utility method to get a StAXBuilder

  Parameters:
    `in` - an InputStream
  Returns:
    a StAXSOAPModelBuilder for the given InputStream
  Throws:
    `javax.xml.stream.XMLStreamException`

### getBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getBuilder(InputStream inStream)
                                                                   throws javax.xml.stream.XMLStreamException

  Creates an OMBuilder for a plain XML message. Default character set encording is used.

  Parameters:
    `inStream` - InputStream for a XML message
  Returns:
    Handler to a OMBuilder implementation instance
  Throws:
    `javax.xml.stream.XMLStreamException`

### getBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getBuilder(InputStream inStream,
                                                                          String charSetEnc)
                                                                   throws javax.xml.stream.XMLStreamException

  Creates an OMBuilder for a plain XML message.

  Parameters:
    `inStream` - InputStream for a XML message
    `charSetEnc` - Character set encoding to be used
  Returns:
    Handler to a OMBuilder implementation instance
  Throws:
    `javax.xml.stream.XMLStreamException`

### getSOAPBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getSOAPBuilder(InputStream inStream)
                                                                       throws javax.xml.stream.XMLStreamException

  Creates an OMBuilder for a SOAP message. Default character set encording is used.

  Parameters:
    `inStream` - InputStream for a SOAP message
  Returns:
    Handler to a OMBuilder implementation instance
  Throws:
    `javax.xml.stream.XMLStreamException`

### getSOAPBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getSOAPBuilder(InputStream inStream,
                                                                              String charSetEnc)
                                                                       throws javax.xml.stream.XMLStreamException

  Creates an OMBuilder for a SOAP message.

  Parameters:
    `inStream` - InputStream for a SOAP message
    `charSetEnc` - Character set encoding to be used
  Returns:
    Handler to a OMBuilder implementation instance
  Throws:
    `javax.xml.stream.XMLStreamException`

### getBuilder

    public static org.apache.axiom.om.impl.builder.StAXBuilder getBuilder(org.apache.axiom.soap.SOAPFactory soapFactory,
                                                                          InputStream in,
                                                                          String charSetEnc)
                                                                   throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### getBuilderFromSelector

    public static Builder getBuilderFromSelector(String type,
                                                 MessageContext msgContext)
                                          throws AxisFault

  Initial work for a builder selector which selects the builder for a given message format based on the the content type of the recieved message. content-type to builder mapping can be specified through the Axis2.xml.

  Parameters:
    `type` - content-type
    `msgContext` - the active MessageContext
  Returns:
    the builder registered against the given content-type
  Throws:
    `AxisFault`

### validateSOAPVersion

    public static void validateSOAPVersion(String soapNamespaceURIFromTransport,
                                           org.apache.axiom.soap.SOAPEnvelope envelope)

### validateCharSetEncoding

    public static void validateCharSetEncoding(String charsetEncodingFromTransport,
                                               String charsetEncodingFromXML,
                                               String soapNamespaceURI)
                                        throws AxisFault

  Throws:
    `AxisFault`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.