Class XmlFileToObjectExtensions


  • public final class XmlFileToObjectExtensions
    extends java.lang.Object
    The class XmlFileToObjectExtensions provides algorithms for transform a given xml file to a java object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T toObject​(com.thoughtworks.xstream.XStream xstream, java.io.File xmlFile)
      Creates from the given xml file a java object
      static <T> T toObject​(com.thoughtworks.xstream.XStream xstream, java.io.File xmlFile, java.lang.String charsetName, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given xml file a java object.
      static <T> T toObject​(com.thoughtworks.xstream.XStream xstream, java.io.File xmlFile, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given xml file a java object.
      static <T> T toObject​(java.io.File xmlFile)
      Creates from the given xml string an java object.
      static <T> T toObject​(java.io.File xmlFile, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given xml file a java 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.io.File xmlFile)
        Creates from the given xml string an java object.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xmlFile - the xml file
        Returns:
        the created object from the given xml file
      • toObject

        public static <T> T toObject​(java.io.File xmlFile,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        Creates from the given xml file a java 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:
        xmlFile - the xml file
        aliases - the aliases
        Returns:
        the created object from the given xml file
      • toObject

        public static <T> T toObject​(com.thoughtworks.xstream.XStream xstream,
                                     java.io.File xmlFile)
        Creates from the given xml file a java object
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        xstream - the xstream object.
        xmlFile - the xml file
        Returns:
        the created object from the given xml file
      • toObject

        public static <T> T toObject​(com.thoughtworks.xstream.XStream xstream,
                                     java.io.File xmlFile,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        Creates from the given xml file a 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.
        xmlFile - the xml file
        aliases - the aliases
        Returns:
        the created object from the given xml file
      • toObject

        public static <T> T toObject​(com.thoughtworks.xstream.XStream xstream,
                                     java.io.File xmlFile,
                                     java.lang.String charsetName,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        Creates from the given xml file a 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.
        xmlFile - the xml file
        charsetName - the encoding name of the charset form the given xml file
        aliases - the aliases
        Returns:
        the created object from the given xml file