Class ConversionService

  • All Implemented Interfaces:
    IConversionService

    public class ConversionService
    extends java.lang.Object
    implements IConversionService
    This interface provides a general conversion service between three different formats:
    • FIN: SWIFT raw format for MT messages (ISO 15022).
    • XML: A proprietary XML representation of SWIFT MT messages.
    • SwiftMessage: Java model of SWIFT MT messages.

    This class may be used as a serializer.

    All methods in this class are thread safe.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFIN​(SwiftMessage msg)
      Given a SwiftMessage object returns a String containing its SWIFT message representation.
      java.lang.String getFIN​(java.lang.String xml)
      Given a String containing a message in its Wife XML internal representation, returns a String containing its SWIFT message representation.
      SwiftMessage getMessageFromFIN​(java.lang.String fin)
      Gets a message object containing the message data from the FIN string message passed as argument.
      SwiftMessage getMessageFromXML​(java.lang.String xml)
      Given a String containing a message in its WIFE internal XML representation, returns a SwiftMessage object.
      java.lang.String getXml​(SwiftMessage msg)
      Given a SwiftMessage objects returns a String containing WIFE internal XML representation of the message.
      java.lang.String getXml​(SwiftMessage msg, boolean useField)
      Given a SwiftMessage objects returns a String containing WIFE internal XML representation of the message.
      java.lang.String getXml​(java.lang.String fin)
      Gets a String containing the XML internal representation of the message from the FIN string message passed as argument.
      java.lang.String getXml​(java.lang.String fin, boolean useField)  
      • Methods inherited from class java.lang.Object

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

      • ConversionService

        public ConversionService()
    • Method Detail

      • getFIN

        public java.lang.String getFIN​(java.lang.String xml)
        Given a String containing a message in its Wife XML internal representation, returns a String containing its SWIFT message representation.
        Specified by:
        getFIN in interface IConversionService
        Parameters:
        xml - the string with the internal XML message to read
        Returns:
        a string with the FIN format representation of the message
        See Also:
        IConversionService.getFIN(java.lang.String)
      • getXml

        public java.lang.String getXml​(SwiftMessage msg,
                                       boolean useField)
        Given a SwiftMessage objects returns a String containing WIFE internal XML representation of the message.
        Since:
        7.6
      • getXml

        public java.lang.String getXml​(java.lang.String fin)
        Description copied from interface: IConversionService
        Gets a String containing the XML internal representation of the message from the FIN string message passed as argument.
        Specified by:
        getXml in interface IConversionService
        Parameters:
        fin - a string containing the FIN message to convert
        Returns:
        a string with the internal XML representation of the message
      • getXml

        public java.lang.String getXml​(java.lang.String fin,
                                       boolean useField)
      • getMessageFromFIN

        public SwiftMessage getMessageFromFIN​(java.lang.String fin)
        Description copied from interface: IConversionService
        Gets a message object containing the message data from the FIN string message passed as argument.
        Specified by:
        getMessageFromFIN in interface IConversionService
        Parameters:
        fin - a string containing the FIN message to convert
        Returns:
        a swift object containing the message data