Class ObjectToXmlFileExtensions


  • public class ObjectToXmlFileExtensions
    extends java.lang.Object
    The class ObjectToXmlFileExtensions provides methods for convert java objects to xml and save them to file objects
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> void toXml​(com.thoughtworks.xstream.XStream xstream, T objectToXML, @NonNull java.io.File file)
      Creates from the given Object an xml string.
      static <T> void toXml​(com.thoughtworks.xstream.XStream xstream, T objectToXML, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases, @NonNull java.io.File file)
      Creates from the given Object an xml string.
      static <T> void toXml​(T object, @NonNull java.io.File file)
      Converts the given object to a xml string and write it to the given file object
      static <T> void toXml​(T objectToXML, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases, @NonNull java.io.File file)
      Creates from the given Object an xml string.
      • Methods inherited from class java.lang.Object

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

      • ObjectToXmlFileExtensions

        public ObjectToXmlFileExtensions()
    • Method Detail

      • toXml

        public static <T> void toXml​(@NonNull
                                     T object,
                                     @NonNull
                                     @NonNull java.io.File file)
        Converts the given object to a xml string and write it to the given file object
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        object - the object to convert to xml
        file - the file object
      • toXml

        public static <T> void toXml​(com.thoughtworks.xstream.XStream xstream,
                                     @NonNull
                                     T objectToXML,
                                     @NonNull
                                     @NonNull java.io.File file)
        Creates from the given Object an xml string.
        Type Parameters:
        T - the generic type of the object that will be transformed to xml
        Parameters:
        xstream - the xstream object.
        objectToXML - the object to xml
        file - the file object
      • toXml

        public static <T> void toXml​(com.thoughtworks.xstream.XStream xstream,
                                     @NonNull
                                     T objectToXML,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases,
                                     @NonNull
                                     @NonNull java.io.File file)
        Creates from the given Object an xml string. 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:
        xstream - the xstream
        objectToXML - the object to xml
        aliases - the aliases
        file - the file object
      • toXml

        public static <T> void toXml​(@NonNull
                                     T objectToXML,
                                     java.util.Map<java.lang.String,​java.lang.Class<?>> aliases,
                                     @NonNull
                                     @NonNull java.io.File file)
        Creates from the given Object an xml string. The given map hold the aliases. For more information with aliasing see documation of xstream.
        Type Parameters:
        T - the generic type of the object that will be transformed to xml
        Parameters:
        objectToXML - the object to xml
        aliases - the aliases
        file - the file object