|
18 | 18 | import java.math.BigDecimal; |
19 | 19 | import java.time.LocalDate; |
20 | 20 | import java.time.LocalDateTime; |
21 | | -import java.util.GregorianCalendar; |
| 21 | +import java.time.format.DateTimeFormatter; |
22 | 22 | import java.util.List; |
23 | 23 | import java.util.UUID; |
24 | 24 |
|
@@ -258,33 +258,32 @@ protected static AddressType createAddress( |
258 | 258 | return addressType; |
259 | 259 | } |
260 | 260 |
|
261 | | - @SuppressWarnings("PMD.ReplaceJavaUtilCalendar") |
262 | 261 | private software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType createMessageSpecCesop() |
263 | 262 | throws DatatypeConfigurationException |
264 | 263 | { |
265 | 264 | LOGGER.debug("Creating messageSpec..."); |
266 | | - |
| 265 | + |
267 | 266 | final software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType messageSpecType = |
268 | 267 | new software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType(); |
269 | | - |
| 268 | + |
270 | 269 | messageSpecType.setTransmittingCountry(MSCountryCodeType.fromValue(this.configuration.getTransmittingCountry() |
271 | 270 | .name())); |
272 | 271 | messageSpecType.setMessageType(MessageTypeType.fromValue(this.configuration.getMessageType().value())); |
273 | 272 | messageSpecType.setMessageTypeIndic(MessageTypeIndicType.fromValue(this.configuration.getMessageTypeIndicEnum() |
274 | 273 | .value())); |
275 | 274 | messageSpecType.setMessageRefId(this.configuration.getMessageRefId()); |
276 | | - |
| 275 | + |
277 | 276 | final ReportingPeriodType reportingPeriodType = new ReportingPeriodType(); |
278 | 277 | reportingPeriodType.setQuarter(this.configuration.getReportingPeriodCesopQuarter()); |
279 | 278 | reportingPeriodType.setYear(this.configuration.getReportingPeriodCesopYear()); |
280 | 279 | messageSpecType.setReportingPeriod(reportingPeriodType); |
281 | | - |
282 | | - final GregorianCalendar gregorianCalendar = GregorianCalendar.from(this.configuration.getTimestamp()); |
283 | | - final XMLGregorianCalendar xmlGregorianCalendar = |
284 | | - DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar); |
285 | | - |
| 280 | + |
| 281 | + final XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance() |
| 282 | + .newXMLGregorianCalendar(this.configuration.getTimestamp() |
| 283 | + .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)); |
| 284 | + |
286 | 285 | messageSpecType.setTimestamp(xmlGregorianCalendar); |
287 | | - |
| 286 | + |
288 | 287 | return messageSpecType; |
289 | 288 | } |
290 | 289 |
|
|
0 commit comments