Class StackTraceElementSwap

java.lang.Object
org.apache.juneau.swap.ObjectSwap<StackTraceElement,String>
org.apache.juneau.swaps.StackTraceElementSwap

Transforms StackTraceElements to String objects.

The swap is identical to just calling StackTraceElement.toString(), but provides the ability to parse the resulting string back into a bean.

See Also:
  • Constructor Details

  • Method Details

    • swap

      public String swap(BeanSession session, StackTraceElement o)
      Converts the specified Enumeration to a List.
      Overrides:
      swap in class ObjectSwap<StackTraceElement,String>
      Parameters:
      session - The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.
      o - The object to be transformed.
      Returns:
      The transformed object.
    • unswap

      public StackTraceElement unswap(BeanSession session, String in, ClassMeta<?> hint)
      Description copied from class: ObjectSwap
      If this transform is to be used to reconstitute objects that aren't true Java beans, it must implement this method.
      Overrides:
      unswap in class ObjectSwap<StackTraceElement,String>
      Parameters:
      session - The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.
      in - The transformed object.
      hint - If possible, the parser will try to tell you the object type being created. For example, on a serialized date, this may tell you that the object being created must be of type GregorianCalendar.
      This may be null if the parser cannot make this determination.
      Returns:
      The narrowed object.