Class XStreamUtil

java.lang.Object
de.uni_trier.wi2.procake.utils.io.xstream.XStreamUtil

public class XStreamUtil extends Object
  • Constructor Details

    • XStreamUtil

      public XStreamUtil()
  • Method Details

    • getDataClassNamesForIdRepresentation

      public static Set<String> getDataClassNamesForIdRepresentation()
    • setDataClassNamesForIdRepresentation

      public static void setDataClassNamesForIdRepresentation(Set<String> classNames)
      Parameters:
      classNames - custom and system data class names of the data objects for which only the objectId should be serialized (if one exists)
    • clearDataClassNamesForIdRepresentation

      public static void clearDataClassNamesForIdRepresentation()
    • isUseDataObjectIdRepresentation

      public static boolean isUseDataObjectIdRepresentation()
    • setUseDataObjectIdRepresentation

      public static void setUseDataObjectIdRepresentation(boolean flag)
    • getXStreamInstanceXml

      public static com.thoughtworks.xstream.XStream getXStreamInstanceXml()
    • resetXStreamInstanceXml

      public static void resetXStreamInstanceXml()
    • getXStreamInstanceJson

      public static com.thoughtworks.xstream.XStream getXStreamInstanceJson()
    • resetXStreamInstanceJson

      public static void resetXStreamInstanceJson()
    • toXML

      public static String toXML(Object o)
      Parameters:
      o - object to be serialized
      Returns:
      Serialized String. Only the objectId of a data object is serialized (if one exists) if the corresponding data object class is registered with XStreamUtil.setDataClassNamesForIdRepresentation()
    • toJSON

      public static String toJSON(Object o)
      Parameters:
      o - object to be serialized
      Returns:
      Serialized String. Only the objectId of a data object is serialized (if one exists) if the corresponding data object class is registered with XStreamUtil.setDataClassNamesForIdRepresentation()
    • fromXML

      public static <T> T fromXML(String xml)
      Parameters:
      xml - string to be deserialized
      Returns:
      object
    • fromJSON

      public static <T> T fromJSON(String json)
      Parameters:
      json - string to be deserialized
      Returns:
      object