Class MxWriteConfiguration


  • public class MxWriteConfiguration
    extends java.lang.Object
    Options to customize the behaviour of the MX writer (model into XML serialization) in the AbstractMX and its specific types subclasses.
    Since:
    9.1.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      TypeAdaptersConfiguration adapters
      Type adapters for the marshaller
      jakarta.xml.bind.JAXBContext context
      Optional instance to pass to the write method, if null, a new instance will be created when needed
      java.lang.String documentPrefix
      The prefix for the document namespace.
      EnvelopeType envelopeTyoe
      Deprecated.
      use envelopeType instead
      EnvelopeType envelopeType
      Defaults to CUSTOM meaning the parameters for the envelope root element are used.
      EscapeHandler escapeHandler
      Enables switching between different implementations for the element and attributes value escaping.
      java.lang.String headerPrefix
      The prefix for the header namespace.
      boolean includeXMLDeclaration
      Determines if the XML will include the XML declaration as first line.
      java.lang.String indent
      Optional indent string to use when marshalling into XML, if null, a four spaces string will be used as default
      java.lang.String rootElement
      When the envelopeType is set to CUSTOM, this parameter enables configuration of the root element name to use when binding the AppHdr and Document elements.
      boolean useCategoryAsDocumentPrefix
      If true, the category code will be used as prefix for the Document element.
    • Method Summary

      • Methods inherited from class java.lang.Object

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

      • rootElement

        public java.lang.String rootElement
        When the envelopeType is set to CUSTOM, this parameter enables configuration of the root element name to use when binding the AppHdr and Document elements. If no root element name is provided and the envelopeTyoe is set to CUSTOM, the value in "RequestPayload" is used as default.
      • includeXMLDeclaration

        public boolean includeXMLDeclaration
        Determines if the XML will include the XML declaration as first line. It is true by default. You can switch this off if the generated XML will then be used a fragment of another XML wrapper.
      • escapeHandler

        public EscapeHandler escapeHandler
        Enables switching between different implementations for the element and attributes value escaping. Some implementations are available in the library and your own custom class can also be used. This is useful if you handle XML messages with specific charset, and you want to control what is escaped and what is propagated as is.
      • headerPrefix

        public java.lang.String headerPrefix
        The prefix for the header namespace. Set it to null if you don't want to have any prefix in header elements. Defaults to "head".
      • documentPrefix

        public java.lang.String documentPrefix
        The prefix for the document namespace. Set it to null if you don't want to have any prefix in document elements. It is "doc" by default.

        Notice the useCategoryAsDocumentPrefix parameter takes precedence over this. Meaning if this is set to anything other than null, and useCategoryAsDocumentPrefix is true, the category will be used as prefix instead of this parameter value. If you want to use your own prefix and not the category, combine this parameter with the useCategoryAsDocumentPrefix set to false.

      • context

        public jakarta.xml.bind.JAXBContext context
        Optional instance to pass to the write method, if null, a new instance will be created when needed
        Since:
        9.3.5
      • indent

        public java.lang.String indent
        Optional indent string to use when marshalling into XML, if null, a four spaces string will be used as default
        Since:
        9.3.6
      • envelopeTyoe

        @Deprecated
        @ProwideDeprecated(phase2=SRU2025)
        public EnvelopeType envelopeTyoe
        Deprecated.
        use envelopeType instead
      • envelopeType

        public EnvelopeType envelopeType
        Defaults to CUSTOM meaning the parameters for the envelope root element are used. This can be changed to SWIFT, BME_V1 or BME_V2 to use the default values for those envelope types. If an envelope other than CUSTOM is selected, the rootElement is ignored and the corresponding envelope structure and namespace will be used instead.
        Since:
        9.5.3
      • useCategoryAsDocumentPrefix

        public boolean useCategoryAsDocumentPrefix
        If true, the category code will be used as prefix for the Document element. For example "camt" or "pacs" depending on the message type. Default is true. This parameter does not take any effect if the documentPrefix is set to null, since in that case no prefix will be used.
        Since:
        9.5.0
    • Constructor Detail

      • MxWriteConfiguration

        public MxWriteConfiguration()
        Creates a configuration with the default options and adapters
      • MxWriteConfiguration

        public MxWriteConfiguration​(jakarta.xml.bind.JAXBContext context)
      • MxWriteConfiguration

        public MxWriteConfiguration​(MxReadConfiguration readConf)
        Creates a configuration with the default options and propagates the adapters from read to write configuration
        Since:
        9.2.6