Class XmlToObjectExtensions


  • public final class XmlToObjectExtensions
    extends java.lang.Object
    The class XmlToObjectExtensions provides methods for convert xml string objects to java objects
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T toObject​(com.thoughtworks.xstream.XStream xstream, java.lang.String xmlString)
      Creates from the given xml string an java object.
      static <T> T toObject​(com.thoughtworks.xstream.XStream xstream, java.lang.String xmlString, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given xml string an java object.
      static <T> T toObject​(java.lang.String xmlString)
      Creates from the given xml string a java object.
      static <T> T toObject​(java.lang.String xmlString, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given xml string an Object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toObject

        public static <T> T toObject​(java.lang.String xmlString)
        Creates from the given xml string a java object.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xmlString - the xml as string object
        Returns:
        the xml string
      • toObject

        public static <T> T toObject​(java.lang.String xmlString,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        Creates from the given xml string an Object. The given map hold the aliases. For more information with aliasing see documation of xstream.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xmlString - the xml as string object
        aliases - the aliases
        Returns:
        the created object from the given xml string.
      • toObject

        public static <T> T toObject​(com.thoughtworks.xstream.XStream xstream,
                                     java.lang.String xmlString)
        Creates from the given xml string an java object.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xstream - the xstream object.
        xmlString - the xml as string object
        Returns:
        the object
      • toObject

        public static <T> T toObject​(com.thoughtworks.xstream.XStream xstream,
                                     java.lang.String xmlString,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        Creates from the given xml string an java object. The given map hold the aliases. For more information with aliasing see documentation of xstream.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xstream - the xstream object.
        xmlString - the xml
        aliases - the aliases
        Returns:
        the object