org.apache.axiom.om.util

## Class CommonUtils

- java.lang.Object
- - org.apache.axiom.om.util.CommonUtils

-     public class CommonUtils
      extends Object

  Common Utilities

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `callStackToString()` Get a string containing the stack of the current location
    `static boolean` | `isTextualPart(String contentType)` A "textual part" has one or more of the following criteria 1) a content-type that start with "text" "application/xml" or "application/soap" 2) has a charset parameter on the content-type.
    `static long` | `logDebug(OMElement om, org.apache.commons.logging.Log log)` Writes the om to a log.debug.
    `static long` | `logDebug(OMElement om, org.apache.commons.logging.Log log, int limit)` Writes the om to a log.debug.
    `static long` | `logDebug(OMElement om, org.apache.commons.logging.Log log, int limit, OMOutputFormat format)` Writes the om to a log.debug.
    `static String` | `replace(String name, String oldT, String newT)` replace: Like String.replace except that the old and new items are strings.
    `static String` | `stackToString(Throwable e)` Get a string containing the stack of the specified exception

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### replace

          public static final String replace(String name,
                                             String oldT,
                                             String newT)

      replace: Like String.replace except that the old and new items are strings.
      Parameters:
        `name` - string
        `oldT` - old text to replace
        `newT` - new text to use
      Returns:
        replacement string

    - #### callStackToString

          public static String callStackToString()

      Get a string containing the stack of the current location
      Returns:
        String

    - #### stackToString

          public static String stackToString(Throwable e)

      Get a string containing the stack of the specified exception
      Parameters:
        `e` -
      Returns:
        TODO

    - #### logDebug

          public static long logDebug(OMElement om,
                                      org.apache.commons.logging.Log log)

      Writes the om to a log.debug. This method assumes optimized mtom attachments Also calculates the length of the message.
      Parameters:
        `om` - OMElement
        `log` - Log
      Returns:
        length of entire message

    - #### logDebug

          public static long logDebug(OMElement om,
                                      org.apache.commons.logging.Log log,
                                      int limit)

      Writes the om to a log.debug. This method assumes optimized mtom attachments Also calculates the length of the message.
      Parameters:
        `om` - OMElement
        `log` - Log
        `limit` - limit of message to write
      Returns:
        length of entire message

    - #### logDebug

          public static long logDebug(OMElement om,
                                      org.apache.commons.logging.Log log,
                                      int limit,
                                      OMOutputFormat format)

      Writes the om to a log.debug. Also calculates the length of the message.
      Parameters:
        `om` - OMElement
        `log` - Log
        `limit` - limit of message to write
        `format` - OMOutputFormat
      Returns:
        length of entire message

    - #### isTextualPart

          public static boolean isTextualPart(String contentType)

      A "textual part" has one or more of the following criteria 1) a content-type that start with "text" "application/xml" or "application/soap" 2) has a charset parameter on the content-type. Example: An part with a content-type of "image/gif" is a non-textual attachment. An part with a content-type of "application/soap+xml" is an textual attachment
      Parameters:
        `contentType` -
      Returns:
        true if text, false otherwise

Copyright © The Apache Software Foundation. All Rights Reserved.