Class StackTraceEncoder

java.lang.Object
org.gcube.common.gxrest.response.entity.StackTraceEncoder

public class StackTraceEncoder extends Object
Encoder for StackTraceElement.
Author:
Manuele Simi (ISTI-CNR), Luca Frosini (ISTI-CNR)
  • Method Details

    • encodeElement

      public static String encodeElement(StackTraceElement element)
      Encodes the stacktrace element as string.
      Parameters:
      element - the element to encode
      Returns:
      the encoded element
    • decodeElement

      public static StackTraceElement decodeElement(String encoded)
      Decodes the string as stacktrace element.
      Parameters:
      encoded - the encoded element
      Returns:
      the decoded element
    • encodeTrace

      public static String encodeTrace(StackTraceElement[] elements, int lines)
      Encodes the stacktrace as string.
      Parameters:
      elements - the elements to encode
      lines - the number of lines to encode
      Returns:
      the encoded trace
    • decodeTrace

      public static StackTraceElement[] decodeTrace(String joinedTrace)
      Decodes the string as stacktrace.
      Parameters:
      joinedTrace - the encoded trace
      Returns:
      the decoded trace