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 4797f34828ed778affc4eb674aec2e12b436cebd Author: Claus Ibsen <[email protected]> AuthorDate: Tue Aug 19 09:41:22 2025 +0200 CAMEL-22354: dataformats - Align all data formats getter setters to model --- .../camel/catalog/dataformats/snakeYaml.json | 2 +- .../org/apache/camel/catalog/models/yaml.json | 2 +- .../apache/camel/catalog/schemas/camel-spring.xsd | 49 +++++---------------- .../apache/camel/catalog/schemas/camel-xml-io.xsd | 49 +++++---------------- .../dsl/yaml/deserializers/ModelDeserializers.java | 51 ++-------------------- .../deserializers/ModelDeserializersResolver.java | 2 - .../generated/resources/schema/camelYamlDsl.json | 26 +---------- 7 files changed, 27 insertions(+), 154 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/snakeYaml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/snakeYaml.json index c031af73545..e6c844eb950 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/snakeYaml.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/snakeYaml.json @@ -26,7 +26,7 @@ "useApplicationContextClassLoader": { "index": 7, "kind": "attribute", "displayName": "Use Application Context Class Loader", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Use ApplicationContextClassLoader as custom ClassLoader" }, "prettyFlow": { "index": 8, "kind": "attribute", "displayName": "Pretty Flow", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force the emitter to produce a pretty YAML document when using the flow style." }, "allowAnyType": { "index": 9, "kind": "attribute", "displayName": "Allow Any Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allow any class to be un-marshaled" }, - "typeFilter": { "index": 10, "kind": "element", "displayName": "Type Filter", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<org.apache.camel.model.dataformat.YAMLTypeFilterDefinition>", "deprecated": false, "autowired": false, "secret": false, "description": "Set the types SnakeYAML is allowed to un-marshall" }, + "typeFilter": { "index": 10, "kind": "attribute", "displayName": "Type Filter", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma." }, "maxAliasesForCollections": { "index": 11, "kind": "attribute", "displayName": "Max Aliases For Collections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "50", "description": "Set the maximum amount of aliases allowed for collections." }, "allowRecursiveKeys": { "index": 12, "kind": "attribute", "displayName": "Allow Recursive Keys", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Set whether recursive keys are allowed." } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/yaml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/yaml.json index 61b64870955..fb46809214f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/yaml.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/yaml.json @@ -23,7 +23,7 @@ "useApplicationContextClassLoader": { "index": 7, "kind": "attribute", "displayName": "Use Application Context Class Loader", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Use ApplicationContextClassLoader as custom ClassLoader" }, "prettyFlow": { "index": 8, "kind": "attribute", "displayName": "Pretty Flow", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force the emitter to produce a pretty YAML document when using the flow style." }, "allowAnyType": { "index": 9, "kind": "attribute", "displayName": "Allow Any Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allow any class to be un-marshaled" }, - "typeFilter": { "index": 10, "kind": "element", "displayName": "Type Filter", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<org.apache.camel.model.dataformat.YAMLTypeFilterDefinition>", "deprecated": false, "autowired": false, "secret": false, "description": "Set the types SnakeYAML is allowed to un-marshall" }, + "typeFilter": { "index": 10, "kind": "attribute", "displayName": "Type Filter", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma." }, "maxAliasesForCollections": { "index": 11, "kind": "attribute", "displayName": "Max Aliases For Collections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "50", "description": "Set the maximum amount of aliases allowed for collections." }, "allowRecursiveKeys": { "index": 12, "kind": "attribute", "displayName": "Allow Recursive Keys", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Set whether recursive keys are allowed." } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index b0b32c4f35e..a531452e0a4 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -2274,15 +2274,6 @@ Transforms the message body based on an expression <xs:documentation xml:lang="en"> <![CDATA[ To configure transformers. -]]> - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="typeFilter" type="tns:yamlTypeFilterDefinition"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -null ]]> </xs:documentation> </xs:annotation> @@ -10778,9 +10769,7 @@ verification is executed. no_signature_allowed: The PGP message must not contain <xs:complexType name="yamlDataFormat"> <xs:complexContent> <xs:extension base="tns:dataFormat"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:typeFilter"/> - </xs:sequence> + <xs:sequence/> <xs:attribute name="library" type="tns:yamlLibrary"> <xs:annotation> <xs:documentation xml:lang="en"> @@ -10858,6 +10847,15 @@ Force the emitter to produce a pretty YAML document when using the flow style. D <xs:documentation xml:lang="en"> <![CDATA[ Allow any class to be un-marshaled. Default value: false +]]> + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="typeFilter" type="xs:string"> + <xs:annotation> + <xs:documentation xml:lang="en"> +<![CDATA[ +Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma. ]]> </xs:documentation> </xs:annotation> @@ -10883,27 +10881,6 @@ Set whether recursive keys are allowed. Default value: false </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="yamlTypeFilterDefinition"> - <xs:sequence/> - <xs:attribute name="value" type="xs:string"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -Value of type such as class name or regular expression. -]]> - </xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="type" type="xs:string"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -Whether to filter by class type or regular expression. Default value: type -]]> - </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> <xs:complexType name="zipDeflaterDataFormat"> <xs:complexContent> <xs:extension base="tns:dataFormat"> @@ -19031,12 +19008,6 @@ An optional certificate alias to use. This is useful when the keystore has multi <xs:enumeration value="KeyValue"/> </xs:restriction> </xs:simpleType> - <xs:simpleType name="yamlTypeFilterType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="type"/> - <xs:enumeration value="regexp"/> - </xs:restriction> - </xs:simpleType> <xs:simpleType name="option"> <xs:restriction base="xs:string"> <xs:enumeration value="DEFAULT_PATH_LEAF_TO_NULL"/> diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd index 572e4963296..c86cc801944 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd @@ -2085,15 +2085,6 @@ Transforms the message body based on an expression <xs:documentation xml:lang="en"> <![CDATA[ To configure transformers. -]]> - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="typeFilter" type="tns:yamlTypeFilterDefinition"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -null ]]> </xs:documentation> </xs:annotation> @@ -9451,9 +9442,7 @@ verification is executed. no_signature_allowed: The PGP message must not contain <xs:complexType name="yamlDataFormat"> <xs:complexContent> <xs:extension base="tns:dataFormat"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:typeFilter"/> - </xs:sequence> + <xs:sequence/> <xs:attribute name="library" type="tns:yamlLibrary"> <xs:annotation> <xs:documentation xml:lang="en"> @@ -9531,6 +9520,15 @@ Force the emitter to produce a pretty YAML document when using the flow style. D <xs:documentation xml:lang="en"> <![CDATA[ Allow any class to be un-marshaled. Default value: false +]]> + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="typeFilter" type="xs:string"> + <xs:annotation> + <xs:documentation xml:lang="en"> +<![CDATA[ +Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma. ]]> </xs:documentation> </xs:annotation> @@ -9556,27 +9554,6 @@ Set whether recursive keys are allowed. Default value: false </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="yamlTypeFilterDefinition"> - <xs:sequence/> - <xs:attribute name="value" type="xs:string"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -Value of type such as class name or regular expression. -]]> - </xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="type" type="xs:string"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -Whether to filter by class type or regular expression. Default value: type -]]> - </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> <xs:complexType name="zipDeflaterDataFormat"> <xs:complexContent> <xs:extension base="tns:dataFormat"> @@ -17041,12 +17018,6 @@ Set the URI of the Endpoint. <xs:enumeration value="KeyValue"/> </xs:restriction> </xs:simpleType> - <xs:simpleType name="yamlTypeFilterType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="type"/> - <xs:enumeration value="regexp"/> - </xs:restriction> - </xs:simpleType> <xs:simpleType name="option"> <xs:restriction base="xs:string"> <xs:enumeration value="DEFAULT_PATH_LEAF_TO_NULL"/> diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java index 2515627a598..7f8326c1482 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java @@ -179,7 +179,6 @@ import org.apache.camel.model.dataformat.UniVocityHeader; import org.apache.camel.model.dataformat.UniVocityTsvDataFormat; import org.apache.camel.model.dataformat.XMLSecurityDataFormat; import org.apache.camel.model.dataformat.YAMLDataFormat; -import org.apache.camel.model.dataformat.YAMLTypeFilterDefinition; import org.apache.camel.model.dataformat.ZipDeflaterDataFormat; import org.apache.camel.model.dataformat.ZipFileDataFormat; import org.apache.camel.model.errorhandler.DeadLetterChannelDefinition; @@ -21238,7 +21237,7 @@ public final class ModelDeserializers extends YamlDeserializerSupport { @YamlProperty(name = "prettyFlow", type = "boolean", description = "Force the emitter to produce a pretty YAML document when using the flow style.", displayName = "Pretty Flow"), @YamlProperty(name = "representer", type = "string", description = "Representer to emit outgoing objects.", displayName = "Representer"), @YamlProperty(name = "resolver", type = "string", description = "Resolver to detect implicit type", displayName = "Resolver"), - @YamlProperty(name = "typeFilter", type = "array:org.apache.camel.model.dataformat.YAMLTypeFilterDefinition", description = "Set the types SnakeYAML is allowed to un-marshall", displayName = "Type Filter"), + @YamlProperty(name = "typeFilter", type = "string", description = "Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma.", displayName = "Type Filter"), @YamlProperty(name = "unmarshalType", type = "string", description = "Class name of the java type to use when unmarshalling", displayName = "Unmarshal Type"), @YamlProperty(name = "useApplicationContextClassLoader", type = "boolean", description = "Use ApplicationContextClassLoader as custom ClassLoader", displayName = "Use Application Context Class Loader") } @@ -21308,8 +21307,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport { break; } case "typeFilter": { - java.util.List<org.apache.camel.model.dataformat.YAMLTypeFilterDefinition> val = asFlatList(node, org.apache.camel.model.dataformat.YAMLTypeFilterDefinition.class); - target.setTypeFilters(val); + String val = asText(node); + target.setTypeFilter(val); break; } case "unmarshalType": { @@ -21330,50 +21329,6 @@ public final class ModelDeserializers extends YamlDeserializerSupport { } } - @YamlType( - nodes = "typeFilter", - types = org.apache.camel.model.dataformat.YAMLTypeFilterDefinition.class, - order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1, - displayName = "YAML Type Filter", - deprecated = false, - properties = { - @YamlProperty(name = "type", type = "enum:type,regexp", defaultValue = "type", description = "Whether to filter by class type or regular expression", displayName = "Type"), - @YamlProperty(name = "value", type = "string", description = "Value of type such as class name or regular expression", displayName = "Value") - } - ) - public static class YAMLTypeFilterDefinitionDeserializer extends YamlDeserializerBase<YAMLTypeFilterDefinition> { - public YAMLTypeFilterDefinitionDeserializer() { - super(YAMLTypeFilterDefinition.class); - } - - @Override - protected YAMLTypeFilterDefinition newInstance() { - return new YAMLTypeFilterDefinition(); - } - - @Override - protected boolean setProperty(YAMLTypeFilterDefinition target, String propertyKey, - String propertyName, Node node) { - propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey); - switch(propertyKey) { - case "type": { - String val = asText(node); - target.setType(val); - break; - } - case "value": { - String val = asText(node); - target.setValue(val); - break; - } - default: { - return false; - } - } - return true; - } - } - @YamlType( nodes = "zipDeflater", types = org.apache.camel.model.dataformat.ZipDeflaterDataFormat.class, diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java index 2c673eb5724..30e9ad08aa7 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java @@ -495,8 +495,6 @@ public final class ModelDeserializersResolver implements YamlDeserializerResolve case "org.apache.camel.model.language.XQueryExpression": return new ModelDeserializers.XQueryExpressionDeserializer(); case "yaml": return new ModelDeserializers.YAMLDataFormatDeserializer(); case "org.apache.camel.model.dataformat.YAMLDataFormat": return new ModelDeserializers.YAMLDataFormatDeserializer(); - case "typeFilter": return new ModelDeserializers.YAMLTypeFilterDefinitionDeserializer(); - case "org.apache.camel.model.dataformat.YAMLTypeFilterDefinition": return new ModelDeserializers.YAMLTypeFilterDefinitionDeserializer(); case "zipDeflater": return new ModelDeserializers.ZipDeflaterDataFormatDeserializer(); case "org.apache.camel.model.dataformat.ZipDeflaterDataFormat": return new ModelDeserializers.ZipDeflaterDataFormatDeserializer(); case "zipFile": return new ModelDeserializers.ZipFileDataFormatDeserializer(); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json index 493cf5506bb..69cb24e0a6b 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json @@ -12526,12 +12526,9 @@ "description" : "Resolver to detect implicit type" }, "typeFilter" : { - "type" : "array", + "type" : "string", "title" : "Type Filter", - "description" : "Set the types SnakeYAML is allowed to un-marshall", - "items" : { - "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.YAMLTypeFilterDefinition" - } + "description" : "Set the types SnakeYAML is allowed to un-marshall. Multiple types can be separated by comma." }, "unmarshalType" : { "type" : "string", @@ -12545,25 +12542,6 @@ } } }, - "org.apache.camel.model.dataformat.YAMLTypeFilterDefinition" : { - "title" : "YAML Type Filter", - "type" : "object", - "additionalProperties" : false, - "properties" : { - "type" : { - "type" : "string", - "title" : "Type", - "description" : "Whether to filter by class type or regular expression", - "default" : "type", - "enum" : [ "type", "regexp" ] - }, - "value" : { - "type" : "string", - "title" : "Value", - "description" : "Value of type such as class name or regular expression" - } - } - }, "org.apache.camel.model.dataformat.ZipDeflaterDataFormat" : { "title" : "Zip Deflater", "description" : "Compress and decompress streams using java.util.zip.Deflater and java.util.zip.Inflater.",
