Class MxParseUtils
- java.lang.Object
-
- com.prowidesoftware.swift.model.mx.MxParseUtils
-
public class MxParseUtils extends java.lang.Object
- Since:
- 9.1.2
-
-
Constructor Summary
Constructors Constructor Description MxParseUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getBICFromDN(java.lang.String dn)
Distinguished Name structure: cn=name,ou=payment,o=bank,o=swift
Example: o=spxainjj,o=swiftstatic java.util.Optional<MxId>
identifyMessage(java.lang.String xml)
Takes an xml with an MX message and detects the specific message type parsing just the namespace from the Document element.
-
-
-
Method Detail
-
getBICFromDN
public static java.lang.String getBICFromDN(java.lang.String dn)
Distinguished Name structure: cn=name,ou=payment,o=bank,o=swift
Example: o=spxainjj,o=swift- Parameters:
dn
- the DN element content- Returns:
- returns capitalized "bank", in the example SPXAINJJ
-
identifyMessage
public static java.util.Optional<MxId> identifyMessage(java.lang.String xml)
Takes an xml with an MX message and detects the specific message type parsing just the namespace from the Document element. If the Document element is not present, or without the namespace or if the namespace url contains invalid content it will return null.Example of a recognizable Document element:
<Doc:Document xmlns:Doc="urn:swift:xsd:camt.003.001.04" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">The implementation is intended to be lightweight and efficient, based on
XMLStreamReader
- Returns:
- id with the detected MX message type or empty if it cannot be determined.
-
-