Package io.github.astrapi69.xstream
Class ObjectToXmlFileExtensions
- java.lang.Object
-
- io.github.astrapi69.xstream.ObjectToXmlFileExtensions
-
public class ObjectToXmlFileExtensions extends java.lang.Object
The classObjectToXmlFileExtensions
provides methods for convert java objects to xml and save them to file objects
-
-
Constructor Summary
Constructors Constructor Description ObjectToXmlFileExtensions()
-
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 objectstatic <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.
-
-
-
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 xmlfile
- 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 xmlfile
- 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 xstreamobjectToXML
- the object to xmlaliases
- the aliasesfile
- 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 xmlaliases
- the aliasesfile
- the file object
-
-