Skip to content

Commit 1d3d9f4

Browse files
committed
Revert "chore: dependencies update and deprecation phase review"
This reverts commit e1d097c.
1 parent e1d097c commit 1d3d9f4

17 files changed

+348
-54
lines changed

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Prowide ISO 20022 - CHANGELOG
22

3-
#### 10.3.0 - SNAPSHOT
4-
* SWIFT Standard release update 2025 (live 22 November 2025)
5-
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
6-
* Dependency update: commons-lang3 -> 3.17.0
7-
* Dependency update: gson -> 2.13.1
8-
93
#### 10.2.7 - April 2025
104
* Enhanced the MX parser log verbosity when parsing malformed content
115
* Added new logic to MxNode to removing all leaves with empty attributes and empty content

build.gradle

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ buildscript {
55
}
66
dependencies {
77
classpath 'ru.vyarus:gradle-quality-plugin:5.0.0'
8-
classpath 'pl.allegro.tech.build:axion-release-plugin:1.18.18'
8+
classpath 'pl.allegro.tech.build:axion-release-plugin:1.15.1'
99
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
10-
classpath 'com.diffplug.spotless:spotless-plugin-gradle:7.0.3'
10+
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.23.3'
1111
}
1212
}
1313
apply plugin: 'pl.allegro.tech.build.axion-release'
@@ -23,12 +23,8 @@ archivesBaseName = 'pw-iso20022'
2323
group 'com.prowidesoftware'
2424

2525
project.ext {
26-
SRU = 'SRU2025'
27-
prowideCoreVersion = 'SRU2025-10.3.0-SNAPSHOT'
28-
commonsLangVersion = '3.17.0'
29-
gsonVersion = '2.13.1'
30-
jaxbVersion = '4.0.5'
31-
jakartaPersistenceVersion = '3.1.0' // jakarta 3.1 is Jakarta EE 10, jakarta 3.2 would imply migration to Jakarta EE 11
26+
SRU = 'SRU2024'
27+
prowideCoreVersion = 'SRU2024-10.2.6'
3228
}
3329

3430
scmVersion {
@@ -38,7 +34,6 @@ scmVersion {
3834
}
3935
}
4036
project.version = "${SRU}-${scmVersion.version}"
41-
project.version = "SRU2025-10.3.0-SNAPSHOT"
4237

4338
allprojects {
4439

@@ -106,9 +101,9 @@ subprojects {
106101
version = rootProject.version
107102

108103
dependencies {
109-
implementation "org.apache.commons:commons-lang3:${commonsLangVersion}"
110-
implementation "com.google.code.gson:gson:${gsonVersion}"
111-
implementation "com.sun.xml.bind:jaxb-impl:${jaxbVersion}"
104+
implementation 'org.apache.commons:commons-lang3:3.17.0'
105+
implementation 'com.google.code.gson:gson:2.11.0'
106+
implementation 'com.sun.xml.bind:jaxb-impl:4.0.5'
112107
// bind-api is included transitively by jaxb-impl
113108
// implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
114109
}
@@ -132,14 +127,14 @@ configure(subprojects.findAll {it.name.endsWith('-mx')}) {
132127
api project(':iso20022-core')
133128
implementation project(specificTypesProject)
134129

135-
implementation "org.apache.commons:commons-lang3:${commonsLangVersion}"
136-
implementation "com.google.code.gson:gson:${gsonVersion}"
130+
implementation 'org.apache.commons:commons-lang3:3.17.0'
131+
implementation 'com.google.code.gson:gson:2.11.0'
137132

138-
implementation "com.sun.xml.bind:jaxb-impl:${jaxbVersion}"
133+
implementation 'com.sun.xml.bind:jaxb-impl:4.0.5'
139134
// bind-api is included transitively by jaxb-impl
140135
// implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
141136

142-
compileOnly "jakarta.persistence:jakarta.persistence-api:${jakartaPersistenceVersion}"
137+
compileOnly 'javax.persistence:javax.persistence-api:2.2'
143138
}
144139
}
145140

@@ -155,13 +150,13 @@ project(':iso20022-core') {
155150
// included build
156151
api "com.prowidesoftware:pw-swift-core:${prowideCoreVersion}"
157152

158-
implementation "org.apache.commons:commons-lang3:${commonsLangVersion}"
159-
implementation "com.google.code.gson:gson:${gsonVersion}"
153+
implementation 'org.apache.commons:commons-lang3:3.17.0'
154+
implementation 'com.google.code.gson:gson:2.11.0'
160155

161-
compileOnly "jakarta.persistence:jakarta.persistence-api:${jakartaPersistenceVersion}"
162-
compileOnly 'jakarta.validation:jakarta.validation-api:3.1.0'
156+
compileOnly 'jakarta.persistence:jakarta.persistence-api:3.1.0'
157+
compileOnly 'jakarta.validation:jakarta.validation-api:3.0.2'
163158

164-
testImplementation "jakarta.persistence:jakarta.persistence-api:${jakartaPersistenceVersion}"
159+
testImplementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
165160
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
166161
testImplementation 'com.google.guava:guava:33.4.0-jre'
167162
testImplementation 'org.assertj:assertj-core:3.27.2'
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
5-
validateDistributionUrl=true
65
zipStoreBase=GRADLE_USER_HOME
76
zipStorePath=wrapper/dists

iso20022-core/src/main/java/com/prowidesoftware/swift/model/MxBusinessProcess.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
package com.prowidesoftware.swift.model;
1717

18+
import com.prowidesoftware.deprecation.ProwideDeprecated;
19+
import com.prowidesoftware.deprecation.TargetYear;
20+
1821
/**
1922
* SWIFT business process classification for MX messages.
2023
*
@@ -54,6 +57,14 @@ public enum MxBusinessProcess {
5457
setr("Securities Trade"),
5558
supl("Supplementary Data"),
5659
trck("Payments Tracker"),
60+
61+
/**
62+
* @deprecated Obsolete to be withdrawn (non-ISO)
63+
*/
64+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
65+
@Deprecated
66+
trea("Treasury"),
67+
5768
tsin("Trade Services Initiation"),
5869
tsmt("Trade Services Management"),
5970
tsrv("Trade Services"),

iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/AbstractMX.java

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.google.gson.Gson;
1919
import com.google.gson.GsonBuilder;
2020
import com.prowidesoftware.JsonSerializable;
21+
import com.prowidesoftware.deprecation.DeprecationUtils;
2122
import com.prowidesoftware.deprecation.ProwideDeprecated;
2223
import com.prowidesoftware.deprecation.TargetYear;
2324
import com.prowidesoftware.swift.model.AbstractMessage;
@@ -26,9 +27,11 @@
2627
import com.prowidesoftware.swift.model.mt.AbstractMT;
2728
import com.prowidesoftware.swift.model.mx.adapters.*;
2829
import com.prowidesoftware.swift.model.mx.adapters.v9.V9DateTimeJsonAdapter;
30+
import com.prowidesoftware.swift.utils.Lib;
2931
import jakarta.xml.bind.JAXBContext;
3032
import jakarta.xml.bind.annotation.XmlTransient;
31-
import java.io.StringReader;
33+
import java.io.*;
34+
import java.nio.charset.StandardCharsets;
3235
import java.time.*;
3336
import java.util.ArrayList;
3437
import java.util.List;
@@ -70,7 +73,7 @@ public abstract class AbstractMX extends AbstractMessage implements JsonSerializ
7073
* @deprecated the default root element for the custom envelope is now defined in {@link EnvelopeType#CUSTOM}
7174
*/
7275
@Deprecated
73-
@ProwideDeprecated(phase3 = TargetYear.SRU2026)
76+
@ProwideDeprecated(phase2 = TargetYear.SRU2025)
7477
public static String DEFAULT_ROOT_ELEMENT = "RequestPayload";
7578

7679
/**
@@ -126,6 +129,17 @@ public static AbstractMX parse(final String xml, MxId id) {
126129
return MxReadImpl.parse(xml, id, new MxReadParams());
127130
}
128131

132+
/**
133+
* @deprecated use Lib.readFile(file) and any parse from String method
134+
*/
135+
@Deprecated
136+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
137+
public static AbstractMX parse(final File file, MxId id) throws IOException {
138+
DeprecationUtils.phase3(
139+
AbstractMX.class, "parse(File, MxId)", "Use Lib.readFile(file) and any parse from String method");
140+
return MxReadImpl.parse(Lib.readFile(file), id, new MxReadParams());
141+
}
142+
129143
/**
130144
* Parses the XML Element into a specific MX object.
131145
* The Mx to create is detected from the namespace.
@@ -398,6 +412,21 @@ public String document() {
398412
return document(params);
399413
}
400414

415+
/**
416+
* @deprecated use {@link #document(MxWriteParams)} instead
417+
*/
418+
@Deprecated
419+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
420+
public String document(final String prefix, boolean includeXMLDeclaration, EscapeHandler escapeHandler) {
421+
DeprecationUtils.phase3(
422+
AbstractMX.class, "document(String, boolean, EscapeHandler)", "Use document(MxWriteParams) instead");
423+
MxWriteParams params = new MxWriteParams();
424+
params.prefix = prefix;
425+
params.includeXMLDeclaration = includeXMLDeclaration;
426+
params.escapeHandler = escapeHandler;
427+
return document(params);
428+
}
429+
401430
/**
402431
* Convenience method to get this message XML as javax.xml.transform.Source.
403432
*
@@ -431,6 +460,34 @@ public String message() {
431460
return message(new MxWriteConfiguration());
432461
}
433462

463+
/**
464+
* @deprecated use {@link #message(MxWriteConfiguration)} and handle write from String to file with plain Java API
465+
*/
466+
@Deprecated
467+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
468+
public void write(final File file) throws IOException {
469+
DeprecationUtils.phase3(AbstractMX.class, "write(File)", "Use message(MxWriteConfiguration) instead");
470+
Objects.requireNonNull(file, "the file to write cannot be null");
471+
boolean created = file.createNewFile();
472+
if (created) {
473+
log.fine("new file created: " + file.getAbsolutePath());
474+
}
475+
final FileOutputStream stream = new FileOutputStream(file.getAbsoluteFile());
476+
write(stream);
477+
stream.close();
478+
}
479+
480+
/**
481+
* @deprecated use {@link #message(MxWriteConfiguration)} and handle write from String to stream with plain Java API
482+
*/
483+
@Deprecated
484+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
485+
public void write(final OutputStream stream) throws IOException {
486+
DeprecationUtils.phase3(AbstractMX.class, "write(OutputStream)", "Use message(MxWriteConfiguration) instead");
487+
Objects.requireNonNull(stream, "the stream to write cannot be null");
488+
stream.write(message().getBytes(StandardCharsets.UTF_8));
489+
}
490+
434491
/**
435492
* @return the business header or null if not set
436493
* @since 9.0.1

iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/AppHdr.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
*/
1616
package com.prowidesoftware.swift.model.mx;
1717

18+
import com.prowidesoftware.deprecation.DeprecationUtils;
19+
import com.prowidesoftware.deprecation.ProwideDeprecated;
20+
import com.prowidesoftware.deprecation.TargetYear;
1821
import java.time.OffsetDateTime;
22+
import java.util.Objects;
1923
import org.w3c.dom.Element;
2024

2125
/**
@@ -102,6 +106,13 @@ public interface AppHdr {
102106
*/
103107
void setCreationDate(boolean overwrite);
104108

109+
/*
110+
* ver MX Headers/stdsmx_usgi.pdf
111+
* doc 3.2.3 Correspondence between the ISO Business Application Header and the Application Header
112+
* de ahi sintentizar los atributos aca.
113+
* replicar metodos unificados segun el mapeo de la seccion 3.2.3
114+
*/
115+
105116
/**
106117
* Get this header as an XML string.
107118
* <p>The implementation uses {@link #xml(MxWriteParams)} with no prefix and no XML declaration.
@@ -112,14 +123,35 @@ default String xml() {
112123
return xml(new MxWriteParams());
113124
}
114125

126+
/**
127+
* @deprecated use {@link #xml(MxWriteParams)} instead
128+
*/
129+
@Deprecated
130+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
131+
String xml(final String prefix, boolean includeXMLDeclaration);
132+
133+
/**
134+
* @deprecated use {@link #xml(MxWriteParams)} instead
135+
*/
136+
@Deprecated
137+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
138+
default String xml(final String prefix, boolean includeXMLDeclaration, EscapeHandler escapeHandler) {
139+
DeprecationUtils.phase3(
140+
AbstractMX.class, "xml(String, boolean, EscapeHandler)", "Use xml(MxWriteParams) instead");
141+
return xml(prefix, includeXMLDeclaration);
142+
}
143+
115144
/**
116145
* Get this header as an XML string.
117146
*
118147
* @param params not null marshalling parameters
119148
* @return header serialized into XML string or null in case of unexpected error
120149
* @since 9.2.6
121150
*/
122-
String xml(MxWriteParams params);
151+
default String xml(MxWriteParams params) {
152+
Objects.requireNonNull(params, "The marshalling params cannot be null");
153+
return xml(params.prefix, params.includeXMLDeclaration);
154+
}
123155

124156
/**
125157
* Gets the header as an Element object.

iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/AppHdrParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public static Optional<AppHdr> parse(final String xml, MxReadParams params) {
5858

5959
Optional<String> namespace = NamespaceReader.findAppHdrNamespace(xml);
6060

61-
boolean headerIsPresent = namespace.isPresent() || MxParseUtils.elementExists(xml, AppHdr.HEADER_LOCALNAME);
61+
boolean headerIsPresent =
62+
namespace.isPresent() || NamespaceReader.elementExists(xml, AppHdr.HEADER_LOCALNAME);
6263

6364
if (headerIsPresent) {
6465
AppHdr parsedHeader = parseHeaderFromSAXSource(xml, namespace.orElse(null), params);

iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/BusinessAppHdrV01.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
package com.prowidesoftware.swift.model.mx;
1717

1818
import com.prowidesoftware.ProwideException;
19+
import com.prowidesoftware.deprecation.DeprecationUtils;
20+
import com.prowidesoftware.deprecation.ProwideDeprecated;
21+
import com.prowidesoftware.deprecation.TargetYear;
1922
import com.prowidesoftware.swift.model.mx.adapters.IsoDateTimeAdapter;
2023
import com.prowidesoftware.swift.model.mx.adapters.ZuluOffsetDateTimeAdapter;
2124
import com.prowidesoftware.swift.model.mx.dic.BusinessApplicationHeaderV01Impl;
@@ -185,6 +188,36 @@ public void setCreationDate(boolean overwrite) {
185188
}
186189
}
187190

191+
/**
192+
* @deprecated use {@link #xml(MxWriteParams)} instead
193+
*/
194+
@Deprecated
195+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
196+
@Override
197+
public String xml(final String prefix, boolean includeXMLDeclaration) {
198+
DeprecationUtils.phase3(AbstractMX.class, "xml(String, boolean)", "Use xml(MxWriteParams) instead");
199+
MxWriteParams params = new MxWriteParams();
200+
params.prefix = prefix;
201+
params.includeXMLDeclaration = includeXMLDeclaration;
202+
return xml(params);
203+
}
204+
205+
/**
206+
* @deprecated use {@link #xml(MxWriteParams)} instead
207+
*/
208+
@Deprecated
209+
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
210+
@Override
211+
public String xml(String prefix, boolean includeXMLDeclaration, EscapeHandler escapeHandler) {
212+
DeprecationUtils.phase3(
213+
AbstractMX.class, "xml(String, boolean, EscapeHandler) ", "Use xml(MxWriteParams) instead");
214+
MxWriteParams params = new MxWriteParams();
215+
params.prefix = prefix;
216+
params.includeXMLDeclaration = includeXMLDeclaration;
217+
params.escapeHandler = escapeHandler;
218+
return xml(params);
219+
}
220+
188221
@Override
189222
public String xml(MxWriteParams params) {
190223
try {

0 commit comments

Comments
 (0)