This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch df2 in repository https://gitbox.apache.org/repos/asf/camel.git
commit e80e76afa277292c0ca9f5987d895579be9b6610 Author: Claus Ibsen <[email protected]> AuthorDate: Mon Aug 18 17:16:06 2025 +0200 CAMEL-22354: dataformats - Align all data formats getter setters to model --- .../swift/mx/SwiftMxDataFormatConfigurer.java | 14 +++ .../apache/camel/dataformat/swift/mt/swiftMt.json | 2 +- .../apache/camel/dataformat/swift/mx/swiftMx.json | 8 +- .../dataformat/swift/mx/SwiftMxDataFormat.java | 50 ++-------- .../routes/SpringSwiftMxDataFormatTest.xml | 4 +- .../org/apache/camel/model/dataformat/swiftMt.json | 2 +- .../org/apache/camel/model/dataformat/swiftMx.json | 8 +- .../camel/model/dataformat/SwiftMtDataFormat.java | 2 +- .../camel/model/dataformat/SwiftMxDataFormat.java | 105 +++++++++++---------- .../dataformat/SwiftMxDataFormatReifier.java | 4 +- .../java/org/apache/camel/xml/in/ModelParser.java | 4 +- .../java/org/apache/camel/xml/out/ModelWriter.java | 4 +- .../org/apache/camel/yaml/out/ModelWriter.java | 4 +- .../ROOT/pages/camel-4x-upgrade-guide-4_15.adoc | 2 + 14 files changed, 100 insertions(+), 113 deletions(-) diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java index 529efe9f711..5649f696e31 100644 --- a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java +++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java @@ -22,7 +22,9 @@ public class SwiftMxDataFormatConfigurer extends org.apache.camel.support.compon private static final Map<String, Object> ALL_OPTIONS; static { Map<String, Object> map = new CaseInsensitiveMap(); + map.put("ReadConfig", com.prowidesoftware.swift.model.mx.MxReadConfiguration.class); map.put("ReadMessageId", com.prowidesoftware.swift.model.MxId.class); + map.put("WriteConfig", com.prowidesoftware.swift.model.mx.MxWriteConfiguration.class); map.put("WriteInJson", boolean.class); ALL_OPTIONS = map; } @@ -31,8 +33,12 @@ public class SwiftMxDataFormatConfigurer extends org.apache.camel.support.compon public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { SwiftMxDataFormat target = (SwiftMxDataFormat) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "readconfig": + case "readConfig": target.setReadConfig(property(camelContext, com.prowidesoftware.swift.model.mx.MxReadConfiguration.class, value)); return true; case "readmessageid": case "readMessageId": target.setReadMessageId(property(camelContext, com.prowidesoftware.swift.model.MxId.class, value)); return true; + case "writeconfig": + case "writeConfig": target.setWriteConfig(property(camelContext, com.prowidesoftware.swift.model.mx.MxWriteConfiguration.class, value)); return true; case "writeinjson": case "writeInJson": target.setWriteInJson(property(camelContext, boolean.class, value)); return true; default: return false; @@ -47,8 +53,12 @@ public class SwiftMxDataFormatConfigurer extends org.apache.camel.support.compon @Override public Class<?> getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { + case "readconfig": + case "readConfig": return com.prowidesoftware.swift.model.mx.MxReadConfiguration.class; case "readmessageid": case "readMessageId": return com.prowidesoftware.swift.model.MxId.class; + case "writeconfig": + case "writeConfig": return com.prowidesoftware.swift.model.mx.MxWriteConfiguration.class; case "writeinjson": case "writeInJson": return boolean.class; default: return null; @@ -59,8 +69,12 @@ public class SwiftMxDataFormatConfigurer extends org.apache.camel.support.compon public Object getOptionValue(Object obj, String name, boolean ignoreCase) { SwiftMxDataFormat target = (SwiftMxDataFormat) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "readconfig": + case "readConfig": return target.getReadConfig(); case "readmessageid": case "readMessageId": return target.getReadMessageId(); + case "writeconfig": + case "writeConfig": return target.getWriteConfig(); case "writeinjson": case "writeInJson": return target.isWriteInJson(); default: return null; diff --git a/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mt/swiftMt.json b/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mt/swiftMt.json index b55c6517394..c70d79a69bb 100644 --- a/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mt/swiftMt.json +++ b/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mt/swiftMt.json @@ -17,6 +17,6 @@ }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, - "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." } + "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." } } } diff --git a/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mx/swiftMx.json b/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mx/swiftMx.json index 21a13a66a1d..5ee723cf151 100644 --- a/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mx/swiftMx.json +++ b/components/camel-swift/src/generated/resources/META-INF/org/apache/camel/dataformat/swift/mx/swiftMx.json @@ -17,9 +17,9 @@ }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, - "writeConfigRef": { "index": 1, "kind": "attribute", "displayName": "Write Config Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." }, - "writeInJson": { "index": 2, "kind": "attribute", "displayName": "Write In Json", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." }, - "readMessageId": { "index": 3, "kind": "attribute", "displayName": "Read Message Id", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." }, - "readConfigRef": { "index": 4, "kind": "attribute", "displayName": "Read Config Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." } + "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." }, + "readMessageId": { "index": 2, "kind": "attribute", "displayName": "Read Message Id", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.MxId", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." }, + "readConfig": { "index": 3, "kind": "attribute", "displayName": "Read Config", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.mx.MxReadConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." }, + "writeConfig": { "index": 4, "kind": "attribute", "displayName": "Write Config", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.mx.MxWriteConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." } } } diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java index 76add7dd7ff..16ccb08b4d1 100644 --- a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java +++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java @@ -128,30 +128,6 @@ public class SwiftMxDataFormat extends ServiceSupport implements DataFormat, Dat } } - /** - * @return the specific configuration to use when marshalling a message. Ignored if {@code writeInJson} is set to - * {@code true}. - */ - public MxWriteConfiguration getWriteConfig() { - return writeConfig; - } - - public void setWriteConfig(Object writeConfig) { - if (writeConfig != null) { - if (writeConfig instanceof MxWriteConfiguration) { - this.writeConfig = (MxWriteConfiguration) writeConfig; - } else { - throw new IllegalArgumentException( - String.format("The argument for setWriteConfig should be subClass of %s", - MxWriteConfiguration.class.getName())); - } - } - } - - /** - * @return the type of MX message to produce when unmarshalling an input stream. If not set, it will be - * automatically detected from the namespace used. - */ public MxId getReadMessageId() { return readMessageId; } @@ -160,28 +136,22 @@ public class SwiftMxDataFormat extends ServiceSupport implements DataFormat, Dat this.readMessageId = readMessageId; } - /** - * @return the specific configuration to use when unmarshalling an input stream. - */ public MxReadConfiguration getReadConfig() { return readConfig; } - public void setReadConfig(Object readConfig) { - if (readConfig != null) { - if (readConfig instanceof MxReadConfiguration) { - this.readConfig = (MxReadConfiguration) readConfig; - } else { - throw new IllegalArgumentException( - String.format("The argument for setReadConfig should be subClass of %s", - MxReadConfiguration.class.getName())); - } - } + public void setReadConfig(MxReadConfiguration readConfig) { + this.readConfig = readConfig; + } + + public MxWriteConfiguration getWriteConfig() { + return writeConfig; + } + + public void setWriteConfig(MxWriteConfiguration writeConfig) { + this.writeConfig = writeConfig; } - /** - * @return {@code true} if messages must be marshalled in a JSON format, {@code false} otherwise. - */ public boolean isWriteInJson() { return writeInJson; } diff --git a/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml b/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml index 76f1bfd87f6..1775a73116c 100644 --- a/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml +++ b/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml @@ -43,7 +43,7 @@ <route> <from uri="direct:unmarshalFull"/> <unmarshal> - <swiftMx writeInJson="false" readMessageId="urn:swift:xsd:xsys.011.001.02" readConfigRef="readConfig" /> + <swiftMx writeInJson="false" readMessageId="urn:swift:xsd:xsys.011.001.02" readConfig="readConfig" /> </unmarshal> <to uri="mock:unmarshalFull"/> </route> @@ -57,7 +57,7 @@ <route> <from uri="direct:marshalFull"/> <marshal> - <swiftMx writeConfigRef="writeConfig"/> + <swiftMx writeConfig="writeConfig"/> </marshal> <to uri="mock:marshalFull"/> </route> diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMt.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMt.json index 039a14a2c32..3c238696476 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMt.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMt.json @@ -14,6 +14,6 @@ }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, - "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." } + "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." } } } diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMx.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMx.json index e54c670fa7e..2d8ce8fa8d9 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMx.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/swiftMx.json @@ -14,9 +14,9 @@ }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, - "writeConfigRef": { "index": 1, "kind": "attribute", "displayName": "Write Config Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." }, - "writeInJson": { "index": 2, "kind": "attribute", "displayName": "Write In Json", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." }, - "readMessageId": { "index": 3, "kind": "attribute", "displayName": "Read Message Id", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." }, - "readConfigRef": { "index": 4, "kind": "attribute", "displayName": "Read Config Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." } + "writeInJson": { "index": 1, "kind": "attribute", "displayName": "Write In Json", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." }, + "readMessageId": { "index": 2, "kind": "attribute", "displayName": "Read Message Id", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.MxId", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." }, + "readConfig": { "index": 3, "kind": "attribute", "displayName": "Read Config", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.mx.MxReadConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." }, + "writeConfig": { "index": 4, "kind": "attribute", "displayName": "Write Config", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.prowidesoftware.swift.model.mx.MxWriteConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." } } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java index c71f2b21140..b3141c560a3 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java @@ -35,7 +35,7 @@ import org.apache.camel.spi.Metadata; public class SwiftMtDataFormat extends DataFormatDefinition { @XmlAttribute - @Metadata(label = "advanced", javaType = "java.lang.Boolean") + @Metadata(javaType = "java.lang.Boolean") private String writeInJson; public SwiftMtDataFormat() { diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java index fcdeef79544..ccfdadac32e 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java @@ -34,22 +34,23 @@ import org.apache.camel.spi.Metadata; @XmlAccessorType(XmlAccessType.FIELD) public class SwiftMxDataFormat extends DataFormatDefinition { - @XmlAttribute - @Metadata(label = "advanced") - private String writeConfigRef; @XmlTransient - private Object writeConfig; + private Object writeConfigObject; + @XmlTransient + private Object readConfigObject; + @XmlAttribute - @Metadata(label = "advanced", javaType = "java.lang.Boolean") + @Metadata(javaType = "java.lang.Boolean") private String writeInJson; @XmlAttribute - @Metadata(label = "advanced") + @Metadata(label = "advanced", javaType = "com.prowidesoftware.swift.model.MxId") private String readMessageId; @XmlAttribute - @Metadata(label = "advanced") - private String readConfigRef; - @XmlTransient - private Object readConfig; + @Metadata(label = "advanced", javaType = "com.prowidesoftware.swift.model.mx.MxReadConfiguration") + private String readConfig; + @XmlAttribute + @Metadata(label = "advanced", javaType = "com.prowidesoftware.swift.model.mx.MxWriteConfiguration") + private String writeConfig; public SwiftMxDataFormat() { super("swiftMx"); @@ -57,12 +58,12 @@ public class SwiftMxDataFormat extends DataFormatDefinition { protected SwiftMxDataFormat(SwiftMxDataFormat source) { super(source); - this.writeConfigRef = source.writeConfigRef; this.writeConfig = source.writeConfig; + this.writeConfigObject = source.writeConfigObject; this.writeInJson = source.writeInJson; this.readMessageId = source.readMessageId; - this.readConfigRef = source.readConfigRef; this.readConfig = source.readConfig; + this.readConfigObject = source.readConfigObject; } public SwiftMxDataFormat(boolean writeInJson) { @@ -70,40 +71,40 @@ public class SwiftMxDataFormat extends DataFormatDefinition { this.writeInJson = Boolean.toString(writeInJson); } - public SwiftMxDataFormat(boolean writeInJson, String readMessageId, Object readConfig) { + public SwiftMxDataFormat(boolean writeInJson, String readMessageId, Object readConfigObject) { this(writeInJson); this.readMessageId = readMessageId; - this.readConfig = readConfig; + this.readConfigObject = readConfigObject; } - public SwiftMxDataFormat(boolean writeInJson, String readMessageId, String readConfigRef) { + public SwiftMxDataFormat(boolean writeInJson, String readMessageId, String readConfig) { this(writeInJson); this.readMessageId = readMessageId; - this.readConfigRef = readConfigRef; + this.readConfig = readConfig; } - public SwiftMxDataFormat(Object writeConfig, String readMessageId, Object readConfig) { + public SwiftMxDataFormat(Object writeConfigObject, String readMessageId, Object readConfigObject) { this(); - this.writeConfig = writeConfig; + this.writeConfigObject = writeConfigObject; this.readMessageId = readMessageId; - this.readConfig = readConfig; + this.readConfigObject = readConfigObject; } - public SwiftMxDataFormat(String writeConfigRef, String readMessageId, String readConfigRef) { + public SwiftMxDataFormat(String writeConfig, String readMessageId, String readConfig) { this(); - this.writeConfigRef = writeConfigRef; + this.writeConfig = writeConfig; this.readMessageId = readMessageId; - this.readConfigRef = readConfigRef; + this.readConfig = readConfig; } private SwiftMxDataFormat(Builder builder) { this(); - this.writeConfigRef = builder.writeConfigRef; this.writeConfig = builder.writeConfig; + this.writeConfigObject = builder.writeConfigObject; this.writeInJson = builder.writeInJson; this.readMessageId = builder.readMessageId; - this.readConfigRef = builder.readConfigRef; this.readConfig = builder.readConfig; + this.readConfigObject = builder.readConfigObject; } @Override @@ -111,15 +112,15 @@ public class SwiftMxDataFormat extends DataFormatDefinition { return new SwiftMxDataFormat(this); } - public Object getWriteConfig() { - return writeConfig; + public Object getWriteConfigObject() { + return writeConfigObject; } /** * The specific configuration to use when marshalling a message. */ - public void setWriteConfig(Object writeConfig) { - this.writeConfig = writeConfig; + public void setWriteConfigObject(Object writeConfigObject) { + this.writeConfigObject = writeConfigObject; } public String getWriteInJson() { @@ -147,37 +148,37 @@ public class SwiftMxDataFormat extends DataFormatDefinition { this.readMessageId = readMessageId; } - public Object getReadConfig() { - return readConfig; + public Object getReadConfigObject() { + return readConfigObject; } /** * The specific configuration to use when unmarshalling an input stream. */ - public void setReadConfig(Object readConfig) { - this.readConfig = readConfig; + public void setReadConfigObject(Object readConfigObject) { + this.readConfigObject = readConfigObject; } - public String getWriteConfigRef() { - return writeConfigRef; + public String getWriteConfig() { + return writeConfig; } /** * Refers to a specific configuration to use when marshalling a message to lookup from the registry. */ - public void setWriteConfigRef(String writeConfigRef) { - this.writeConfigRef = writeConfigRef; + public void setWriteConfig(String writeConfig) { + this.writeConfig = writeConfig; } - public String getReadConfigRef() { - return readConfigRef; + public String getReadConfig() { + return readConfig; } /** * Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry. */ - public void setReadConfigRef(String readConfigRef) { - this.readConfigRef = readConfigRef; + public void setReadConfig(String readConfig) { + this.readConfig = readConfig; } /** @@ -186,18 +187,18 @@ public class SwiftMxDataFormat extends DataFormatDefinition { @XmlTransient public static class Builder implements DataFormatBuilder<SwiftMxDataFormat> { - private String writeConfigRef; - private Object writeConfig; + private String writeConfig; + private Object writeConfigObject; private String writeInJson; private String readMessageId; - private String readConfigRef; - private Object readConfig; + private String readConfig; + private Object readConfigObject; /** * The specific configuration to use when marshalling a message. */ - public Builder writeConfig(Object writeConfig) { - this.writeConfig = writeConfig; + public Builder writeConfigObject(Object writeConfigObject) { + this.writeConfigObject = writeConfigObject; return this; } @@ -233,24 +234,24 @@ public class SwiftMxDataFormat extends DataFormatDefinition { /** * The specific configuration to use when unmarshalling an input stream. */ - public Builder readConfig(Object readConfig) { - this.readConfig = readConfig; + public Builder readConfigObject(Object readConfigObject) { + this.readConfigObject = readConfigObject; return this; } /** * Refers to a specific configuration to use when marshalling a message to lookup from the registry. */ - public Builder writeConfigRef(String writeConfigRef) { - this.writeConfigRef = writeConfigRef; + public Builder writeConfigObject(String writeConfig) { + this.writeConfig = writeConfig; return this; } /** * Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry. */ - public Builder readConfigRef(String readConfigRef) { - this.readConfigRef = readConfigRef; + public Builder readConfig(String readConfig) { + this.readConfig = readConfig; return this; } diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java index 901bda37571..f7a20402c5d 100644 --- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java @@ -30,9 +30,9 @@ public class SwiftMxDataFormatReifier extends DataFormatReifier<SwiftMxDataForma @Override protected void prepareDataFormatConfig(Map<String, Object> properties) { - properties.put("writeConfig", or(definition.getWriteConfig(), asRef(definition.getWriteConfigRef()))); + properties.put("writeConfig", or(definition.getWriteConfigObject(), asRef(definition.getWriteConfig()))); properties.put("writeInJson", definition.getWriteInJson()); properties.put("readMessageId", definition.getReadMessageId()); - properties.put("readConfig", or(definition.getReadConfig(), asRef(definition.getReadConfigRef()))); + properties.put("readConfig", or(definition.getReadConfigObject(), asRef(definition.getReadConfig()))); } } diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java index d2f127616f3..fef66d5f9a7 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java @@ -2154,9 +2154,9 @@ public class ModelParser extends BaseParser { } protected SwiftMxDataFormat doParseSwiftMxDataFormat() throws IOException, XmlPullParserException { return doParse(new SwiftMxDataFormat(), (def, key, val) -> switch (key) { - case "readConfigRef": def.setReadConfigRef(val); yield true; + case "readConfig": def.setReadConfig(val); yield true; case "readMessageId": def.setReadMessageId(val); yield true; - case "writeConfigRef": def.setWriteConfigRef(val); yield true; + case "writeConfig": def.setWriteConfig(val); yield true; case "writeInJson": def.setWriteInJson(val); yield true; default: yield identifiedTypeAttributeHandler().accept(def, key, val); }, noElementHandler(), noValueHandler()); diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java index fafe173f5d4..825aba50822 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java @@ -2860,10 +2860,10 @@ public class ModelWriter extends BaseWriter { protected void doWriteSwiftMxDataFormat(String name, SwiftMxDataFormat def) throws IOException { startElement(name); doWriteIdentifiedTypeAttributes(def); + doWriteAttribute("readConfig", def.getReadConfig(), null); + doWriteAttribute("writeConfig", def.getWriteConfig(), null); doWriteAttribute("readMessageId", def.getReadMessageId(), null); doWriteAttribute("writeInJson", def.getWriteInJson(), null); - doWriteAttribute("writeConfigRef", def.getWriteConfigRef(), null); - doWriteAttribute("readConfigRef", def.getReadConfigRef(), null); endElement(name); } protected void doWriteSyslogDataFormat(String name, SyslogDataFormat def) throws IOException { diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java index 43f8f17ea8d..5e465ef7215 100644 --- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java +++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java @@ -2860,10 +2860,10 @@ public class ModelWriter extends BaseWriter { protected void doWriteSwiftMxDataFormat(String name, SwiftMxDataFormat def) throws IOException { startElement(name); doWriteIdentifiedTypeAttributes(def); + doWriteAttribute("readConfig", def.getReadConfig(), null); + doWriteAttribute("writeConfig", def.getWriteConfig(), null); doWriteAttribute("readMessageId", def.getReadMessageId(), null); doWriteAttribute("writeInJson", def.getWriteInJson(), null); - doWriteAttribute("writeConfigRef", def.getWriteConfigRef(), null); - doWriteAttribute("readConfigRef", def.getReadConfigRef(), null); endElement(name); } protected void doWriteSyslogDataFormat(String name, SyslogDataFormat def) throws IOException { diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_15.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_15.adoc index 61abf5bbe4c..c19f4f84800 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_15.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_15.adoc @@ -22,6 +22,8 @@ to their implementation using reflection-free configurers. A few data formats ha |jaxb|namespacePrefixRef|namespacePrefix |soap|namespacePrefixRef|namespacePrefix |soap|elementNameStrategyRef|elementNameStrategy +|swiftMx|readConfigRef|readConfig +|swiftMx|writeConfigRef|writeConfig |=== And in XML DSL the csv dataformat have changed `header` from a `List<String>` to be a single `String`
