Package io.github.astrapi69.xstream
Class XmlToObjectExtensions
- java.lang.Object
-
- io.github.astrapi69.xstream.XmlToObjectExtensions
-
public final class XmlToObjectExtensions extends java.lang.Object
The classXmlToObjectExtensions
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.
-
-
-
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 objectaliases
- 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 xmlaliases
- the aliases- Returns:
- the object
-
-