Class SwiftParserConfiguration


  • public class SwiftParserConfiguration
    extends java.lang.Object
    Container class for MT parser parameters. This can be passed to the parser to control fine grain details of the process.
    Since:
    7.8
    • Constructor Detail

      • SwiftParserConfiguration

        public SwiftParserConfiguration()
    • Method Detail

      • isLenient

        public boolean isLenient()
        Indicates whether the parser is permissive or not. Defaults to true, meaning the parser will do a best effort to read as much from the message content as possible regardless of the content and block boundaries beeing valid or not. For instance, it will read the headers even if the value length is incorrect, and it will read the text block (block 4) even if it is missing the closing hyphen and bracket.

        When set to false, the parser will be strict, and will throw IllegalArgumentException when the headers block 1 and 2 have an incorrect value and when a block is not properly ended with the closing bracket or with the hyphen plus bracket in case of the block 4. Notice the strict mode does not imply the parser will do syntax and semantic validation though.

      • setLenient

        public void setLenient​(boolean lenient)
        See Also:
        isLenient()
      • isParseTextBlock

        public boolean isParseTextBlock()
        Defines if the text block (block 4) will be parsed. Defaults to true.
      • setParseTextBlock

        public void setParseTextBlock​(boolean parseTextBlock)
      • isParseTrailerBlock

        public boolean isParseTrailerBlock()
        Defines if the trailer block (block 5) will be parsed. Defaults to true.
      • setParseTrailerBlock

        public void setParseTrailerBlock​(boolean parseTrailerBlock)
      • isParseUserBlock

        public boolean isParseUserBlock()
        Defines if the optional user block will be parsed. Defaults to true.
      • setParseUserBlock

        public void setParseUserBlock​(boolean parseUserBlock)