Class Caller

java.lang.Object
org.jpos.util.Caller

public class Caller extends Object
Return Caller's short class name, method and line number
  • Constructor Summary

    Constructors
    Constructor
    Description
    Utility class; instances carry no state.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Returns information for the immediate caller of the method that calls this helper.
    static String
    info(int pos)
    Returns information for the caller pos frames above the immediate caller.
    static String
    Formats a stack trace element as abbreviatedClass.method:line.
    static String
    Abbreviates a fully-qualified class name by collapsing every package segment to its first character (e.g.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Caller

      public Caller()
      Utility class; instances carry no state.
  • Method Details

    • info

      public static String info()
      Returns information for the immediate caller of the method that calls this helper.
      Returns:
      abbreviated class.method:line string
    • info

      public static String info(int pos)
      Returns information for the caller pos frames above the immediate caller.
      Parameters:
      pos - additional stack frames to skip past the immediate caller
      Returns:
      abbreviated class.method:line string
    • info

      public static String info(StackTraceElement st)
      Formats a stack trace element as abbreviatedClass.method:line.
      Parameters:
      st - stack frame to format
      Returns:
      abbreviated class.method:line string
    • shortClassName

      public static String shortClassName(String clazz)
      Abbreviates a fully-qualified class name by collapsing every package segment to its first character (e.g. o.j.u.Caller).
      Parameters:
      clazz - fully-qualified class name
      Returns:
      the abbreviated class name