Class SubscriptionXStreamAliasConverter

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class SubscriptionXStreamAliasConverter
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware
    XStream helper for subscriptions.
    • Constructor Detail

      • SubscriptionXStreamAliasConverter

        public SubscriptionXStreamAliasConverter()
    • Method Detail

      • getXStreamXmlFromSubscriptionProductData

        @Nonnull
        public java.lang.String getXStreamXmlFromSubscriptionProductData​(@Nullable
                                                                         ProductData productData)
        Convert product dto to xml string.
        Parameters:
        productData - DTO. can be null (empty XML will be returned)
        Returns:
        xml representation of the object
      • getSubscriptionProductDataFromXml

        @Nullable
        public ProductData getSubscriptionProductDataFromXml​(@Nullable
                                                             java.lang.String xml)
        Convert xml string to instance of ProductData.
        Parameters:
        xml - xml string
        Returns:
        unmarshalled object of null if xml is empty
        Throws:
        com.thoughtworks.xstream.converters.ConversionException - if class is unavailable
        java.lang.ClassCastException - is the XML contains another type of object
      • getXstream

        @Nonnull
        public com.thoughtworks.xstream.XStream getXstream()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext context)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException