Package com.prowidesoftware.swift.io
Class ConversionService
- java.lang.Object
-
- com.prowidesoftware.swift.io.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.
-
-
Constructor Summary
Constructors Constructor Description ConversionService()
-
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)
-
-
-
Method Detail
-
getFIN
public java.lang.String getFIN(SwiftMessage msg)
Given a SwiftMessage object returns a String containing its SWIFT message representation.The implementation ensures all line breaks use CRLF, and ignores all empty blocks.
- Specified by:
getFIN
in interfaceIConversionService
- Parameters:
msg
- an object containing the message to convert- Returns:
- a string with the FIN format representation of the message
- See Also:
IConversionService.getFIN(com.prowidesoftware.swift.model.SwiftMessage)
-
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 interfaceIConversionService
- 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)
Given a SwiftMessage objects returns a String containing WIFE internal XML representation of the message.- Specified by:
getXml
in interfaceIConversionService
- Parameters:
msg
- an object containing the message to convert- Returns:
- a string with the internal XML representation of the message
- See Also:
IConversionService.getXml(com.prowidesoftware.swift.model.SwiftMessage)
-
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 interfaceIConversionService
- 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 interfaceIConversionService
- Parameters:
fin
- a string containing the FIN message to convert- Returns:
- a swift object containing the message data
-
getMessageFromXML
public SwiftMessage getMessageFromXML(java.lang.String xml)
Given a String containing a message in its WIFE internal XML representation, returns a SwiftMessage object.- Specified by:
getMessageFromXML
in interfaceIConversionService
- Parameters:
xml
- the string with the internal XML message to read- Returns:
- a swift object containing the message data
- See Also:
IConversionService.getMessageFromXML(java.lang.String)
-
-