Class ObjectToXmlExtensions


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.lang.String toXml​(com.thoughtworks.xstream.XStream xstream, T objectToXML)
      Creates from the given Object an xml string.
      static <T> java.lang.String toXml​(com.thoughtworks.xstream.XStream xstream, T objectToXML, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      Creates from the given Object an xml string.
      static <T> java.lang.String toXml​(T objectToXML)
      Creates from the given Object an xml string.
      static <T> java.lang.String toXml​(T objectToXML, java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
      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

      • ObjectToXmlExtensions

        public ObjectToXmlExtensions()
    • Method Detail

      • toXml

        public static <T> java.lang.String toXml​(T objectToXML)
        Creates from the given Object an xml string.
        Type Parameters:
        T - the generic type of the return type
        Parameters:
        objectToXML - the object to xml
        Returns:
        the xml string
      • toXml

        public static <T> java.lang.String toXml​(com.thoughtworks.xstream.XStream xstream,
                                                 T objectToXML)
        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
        Returns:
        the xml string
      • toXml

        public static <T> java.lang.String toXml​(com.thoughtworks.xstream.XStream xstream,
                                                 T objectToXML,
                                                 java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        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
        Returns:
        the xml string
      • toXml

        public static <T> java.lang.String toXml​(T objectToXML,
                                                 java.util.Map<java.lang.String,​java.lang.Class<?>> aliases)
        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
        Returns:
        the xml string