Class MxParser


  • @Deprecated
    @ProwideDeprecated(phase4=SRU2023)
    public class MxParser
    extends java.lang.Object
    Deprecated.
    see deprecation notes on each method
    This class is currently deprecated. The API provided is no longer useful or has been replaced by similar or moved methods in: AbstractMX, AppHdr, AppHdrParser, MxNode or MxParseUtils
    Since:
    7.6
    • Constructor Detail

      • MxParser

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public MxParser​(java.io.File file)
                 throws java.io.IOException
        Deprecated.
        Use similar API in AbstractMX, AppHdr, AppHdrParser, MxNode or MxParseUtils instead
        Throws:
        java.io.IOException
      • MxParser

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public MxParser​(java.io.InputStream stream)
                 throws java.io.IOException
        Deprecated.
        Use similar API in AbstractMX, AppHdr, AppHdrParser, MxNode or MxParseUtils instead
        Throws:
        java.io.IOException
    • Method Detail

      • parseAppHdr

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public static AppHdr parseAppHdr​(org.w3c.dom.Element e)
        Deprecated.
        Since:
        9.0.1
      • getBICFromDN

        @ProwideDeprecated(phase4=SRU2023)
        @Deprecated
        public static java.lang.String getBICFromDN​(java.lang.String dn)
        Deprecated.
      • parseAppHdr

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public AppHdr parseAppHdr()
        Deprecated.
        Returns:
        parsed header or null if the content cannot be parsed or the header is not present in the XML
        Since:
        9.0.1
      • detectMessage

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public MxId detectMessage()
        Deprecated.
        Returns:
        id with the detected MX message type or null if it cannot be determined.
        Since:
        7.7
      • analyzeMessage

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public MxParser.MxStructureInfo analyzeMessage()
        Deprecated.
        the AbstractMX.parse(String) can be used to parse any unknown message. If you just want to detect the message type you can also use the MxParseUtils.identifyMessage(String)
        Convenient API to get structure information from an MX message.

        This can be helpful when the actual content of an XML is unknown and some preprocessing of the XML must be done in order to parse or validate its content properly.

        The implementation is intended to be lightweight and efficient, based on XMLStreamReader

        If the message contains more than one Document element, the first one will be picked. The same applies for the header, only the first AppHdr will be picked

        Since:
        7.10.3
      • stripDocument

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public java.lang.String stripDocument()
        Deprecated.
        parse the message using AbstractMX.parse(String) instead, and then use any of the document serializer methods such as AbstractMX.document()
        Helper API to strip Document portion of message XML.

        This API is convenient when only the Document element of an MX message is needed and the wrapper/payload structure is unknown.

        This implementation is intended to be lightweight and efficient so it actually does a simple substring operation on the XML using information provided by the result of analyzeMessage(). The XML is not converted into DOM on purpose because we want to strip the content event when the XML is not totally well-formed.

        If the message contains more than one Document element the expected result is as follows:

        • If the documents are nested (this can happen for example when an additional MX message is provided within a supplementary data element within the main MX) then the outermost Document will be returned.
        • If the documents are not-nested (weird situation) the result might be not well-formed
        Returns:
        XML with Document element of the Mx message or null if message is blank or invalid
        Since:
        7.8.4
      • stripHeader

        @Deprecated
        @ProwideDeprecated(phase4=SRU2023)
        public java.lang.String stripHeader()
        Deprecated.
        parse the message using AbstractMX.parse(String) instead, and then use any of the header serializer methods such as AbstractMX.header()
        Helper API to strip AppHdr portion of message XML.

        This API is convenient when only the header element of an MX message is needed and the wrapper/payload structure is unknown.

        To gather the header already parsed into objects see parseBusinessHeader()

        This implementation is intended to be lightweight and efficient so it actually does a simple substring operation on the XML using information provided by the result of analyzeMessage(). The XML is not converted into DOM.
        If the message contains more than one AppHdr element the expected result is as follows:

        • If the headers are not nested, the first one will be returned.
        • If the headers are nested (weird situation) the result might be not well-formed
        Returns:
        XML with AppHdr element of the Mx message or null if not found
        Since:
        7.8.4