The following example shows error message output at the parse debug level:
[main] PARSE - Swift: matchDelimSkip("{1:") --> true. [main] PARSE - Swift: getData("F|A|L") --> "F". [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped data("F"). [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped rep[0]. [main] PARSE - Swift: getData(charSet, 2, 2) --> "01". [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.ServiceIdentifier: 4: The following is the last field successfully parsed the 4th 22a: [main] PARSE - Swift: matchDelimSkip("22H::") --> true. [main] PARSE - Swift: getData(charSet, 4, 4) --> "PAYM". [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3: 218: Mapped data("PAYM"). [main] PARSE - Swift: matchDelimSkip("//") --> true. [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3: 218: Mapped rep[0]. [main] PARSE - Swift: getData(charSet, 4, 4) --> "APMT". [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5: 224: Mapped data("APMT"). [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5: 224: Mapped rep[0]. [main] PARSE - Swift: matchDelimSkip(" :") --> true. [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 213: Mapped rep[0]. |
The message goes on for several more lines, not indicating any error. Then the parser is looking for any more 22a’s, F or H, and does not find one. See the following example:
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator[3]: 159: Mapped rep[3]. [main] PARSE - Swift: matchDelimSkip("22F::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorF: 231: Failed to find BeginDelimiter("22F::"). [main] PARSE - Swift: matchDelimSkip("22H::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 231: Failed to find BeginDelimiter("22H::"). |
The parser then looks for a 98a either option A|B|C as follows:
[main] PARSE - Swift: matchDelimSkip("98A::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeA: 231: Failed to find BeginDelimiter("98A::"). [main] PARSE - Swift: matchDelimSkip("98B::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeB: 231: Failed to find BeginDelimiter("98B::"). [main] PARSE - Swift: matchDelimSkip("98C::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeC: 231: Failed to find BeginDelimiter("98C::"). |
The parser finds no repetitions, which does not fit in the required range of 1 to 3 as described in the following example, so at this point, the parser fails, because no expected repetitions were found:
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails: 231: Failed to match minimum repititions[ 1 < 0 <= 3 ]. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails: 145: Failed to parse required child(DateTime). [main] PARSE - Swift: mt_502.Mt_502.Data: 145: Failed to match minimum repititions[ 1 < 0 <= 1 ]. [main] PARSE - Swift: mt_502.Mt_502.Data: 73: Failed to parse required child(OrderDetails). [main] PARSE - Swift: mt_502.Mt_502: 67: Failed to match minimum repititions[ 1 < 0 <= 1 ]. [main] PARSE - Swift: mt_502.Mt_502: 0: Failed to parse required child(Data). [main] LAST - Swift: Last match: mt_502.Mt_502. Exception in thread "main" at 0: null: com.stc. swift.runtime.SwiftUnmarshalException: mt_502.Mt_502: 0: Failed to parse required child(Data). at com.stc.swift.runtime.SwiftOtdRep. throwExcept(SwiftOtdRep.java:1977) at com.stc.swift.runtime.SwiftOtdRep. parseChildren(SwiftOtdRep.java:1577) at com.stc.swift.runtime.SwiftOtdRep. parse(SwiftOtdRep.java:1486) at com.stc.swift.runtime.SwiftOtdRep. unmarshal(SwiftOtdRep.java:1339) |