This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch kamelet-ctr3 in repository https://gitbox.apache.org/repos/asf/camel.git
commit f8c158299cd9323eb962f4d3ca93123204ed8990 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu May 2 19:52:47 2024 +0200 CAMEL-20514: camel-model - Add support for bean constructors for beans in route templates or kamelets --- .../org/apache/camel/catalog/models.properties | 1 - .../apache/camel/catalog/models/templateBean.json | 28 --------- .../apache/camel/catalog/schemas/camel-spring.xsd | 16 ----- .../org/apache/camel/model/templateBean.json | 28 --------- .../services/org/apache/camel/model.properties | 1 - .../resources/org/apache/camel/model/jaxb.index | 1 - .../camel/model/RouteTemplateBeanDefinition.java | 34 ----------- .../java/org/apache/camel/xml/in/ModelParser.java | 71 +++++++++++----------- .../java/org/apache/camel/xml/out/ModelWriter.java | 9 --- .../org/apache/camel/yaml/out/ModelWriter.java | 9 --- .../dsl/yaml/deserializers/CustomResolver.java | 2 - .../RouteTemplateBeanDefinitionDeserializer.java | 63 ------------------- .../generated/resources/schema/camelYamlDsl.json | 43 ------------- 13 files changed, 34 insertions(+), 272 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties index d229b8e480f..737505a8fcd 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties @@ -190,7 +190,6 @@ swiftMt swiftMx syslog tarFile -templateBean templateParameter templatedRoute templatedRouteBean diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/templateBean.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/templateBean.json deleted file mode 100644 index 75e1336ad48..00000000000 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/templateBean.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "model": { - "kind": "model", - "name": "templateBean", - "title": "Template Bean", - "description": "A route template bean (local bean)", - "deprecated": true, - "label": "configuration", - "javaType": "org.apache.camel.model.RouteTemplateBeanDefinition", - "abstract": false, - "input": false, - "output": false - }, - "properties": { - "name": { "index": 0, "kind": "attribute", "displayName": "Name", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean (bean id)" }, - "type": { "index": 1, "kind": "attribute", "displayName": "Type", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name (fully qualified) of the bean" }, - "initMethod": { "index": 2, "kind": "attribute", "displayName": "Init Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the custom initialization method to invoke after setting bean properties. The method must have no arguments, but may throw any exception." }, - "destroyMethod": { "index": 3, "kind": "attribute", "displayName": "Destroy Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the custom destroy method to invoke on bean shutdown, such as when Camel is shutting down. The method must have no arguments, but may throw any exception." }, - "factoryMethod": { "index": 4, "kind": "attribute", "displayName": "Factory Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of method to invoke when creating the bean via a factory bean." }, - "factoryBean": { "index": 5, "kind": "attribute", "displayName": "Factory Bean", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of factory bean (bean id) to use for creating the bean." }, - "builderClass": { "index": 6, "kind": "attribute", "displayName": "Builder Class", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Fully qualified class name of builder class to use for creating and configuring the bean. The builder will use the properties values to configure the bean." }, - "builderMethod": { "index": 7, "kind": "attribute", "displayName": "Builder Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "build", "description": "Name of method when using builder class. This method is invoked after configuring to create the actual bean. This method is often named build (used by default)." }, - "scriptLanguage": { "index": 8, "kind": "attribute", "displayName": "Script Language", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The script language to use when using inlined script for creating the bean, such as groovy, java, javascript etc." }, - "constructors": { "index": 9, "kind": "element", "displayName": "Constructors", "group": "common", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.Integer, java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Optional constructor arguments for creating the bean. Arguments correspond to specific index of the constructor argument list, starting from zero." }, - "properties": { "index": 10, "kind": "element", "displayName": "Properties", "group": "common", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Optional properties to set on the created bean." }, - "script": { "index": 11, "kind": "element", "displayName": "Script", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The script to execute that creates the bean when using scripting languages. If the script use the prefix resource: such as resource:classpath:com\/foo\/myscript.groovy, resource:file:\/var\/myscript.groovy, then its loaded from the ex [...] - } -} 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 ed2e0edffc1..56c1a04480e 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 @@ -1919,15 +1919,6 @@ Archive files into tarballs or extract files from tarballs. <xs:documentation xml:lang="en"> <![CDATA[ Configures a ProducerTemplate -]]> - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="templateBean" type="tns:routeTemplateBeanDefinition"> - <xs:annotation> - <xs:documentation xml:lang="en"> -<![CDATA[ -Deprecated: A route template bean (local bean) ]]> </xs:documentation> </xs:annotation> @@ -12521,13 +12512,6 @@ Whether tracing is enabled on this route. </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="routeTemplateBeanDefinition"> - <xs:complexContent> - <xs:extension base="tns:beanFactoryDefinition"> - <xs:sequence/> - </xs:extension> - </xs:complexContent> - </xs:complexType> <xs:complexType name="routeTemplateContextRefDefinition"> <xs:sequence/> <xs:attribute name="ref" type="xs:string" use="required"> diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/templateBean.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/templateBean.json deleted file mode 100644 index 75e1336ad48..00000000000 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/templateBean.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "model": { - "kind": "model", - "name": "templateBean", - "title": "Template Bean", - "description": "A route template bean (local bean)", - "deprecated": true, - "label": "configuration", - "javaType": "org.apache.camel.model.RouteTemplateBeanDefinition", - "abstract": false, - "input": false, - "output": false - }, - "properties": { - "name": { "index": 0, "kind": "attribute", "displayName": "Name", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean (bean id)" }, - "type": { "index": 1, "kind": "attribute", "displayName": "Type", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name (fully qualified) of the bean" }, - "initMethod": { "index": 2, "kind": "attribute", "displayName": "Init Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the custom initialization method to invoke after setting bean properties. The method must have no arguments, but may throw any exception." }, - "destroyMethod": { "index": 3, "kind": "attribute", "displayName": "Destroy Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the custom destroy method to invoke on bean shutdown, such as when Camel is shutting down. The method must have no arguments, but may throw any exception." }, - "factoryMethod": { "index": 4, "kind": "attribute", "displayName": "Factory Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of method to invoke when creating the bean via a factory bean." }, - "factoryBean": { "index": 5, "kind": "attribute", "displayName": "Factory Bean", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of factory bean (bean id) to use for creating the bean." }, - "builderClass": { "index": 6, "kind": "attribute", "displayName": "Builder Class", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Fully qualified class name of builder class to use for creating and configuring the bean. The builder will use the properties values to configure the bean." }, - "builderMethod": { "index": 7, "kind": "attribute", "displayName": "Builder Method", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "build", "description": "Name of method when using builder class. This method is invoked after configuring to create the actual bean. This method is often named build (used by default)." }, - "scriptLanguage": { "index": 8, "kind": "attribute", "displayName": "Script Language", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The script language to use when using inlined script for creating the bean, such as groovy, java, javascript etc." }, - "constructors": { "index": 9, "kind": "element", "displayName": "Constructors", "group": "common", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.Integer, java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Optional constructor arguments for creating the bean. Arguments correspond to specific index of the constructor argument list, starting from zero." }, - "properties": { "index": 10, "kind": "element", "displayName": "Properties", "group": "common", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Optional properties to set on the created bean." }, - "script": { "index": 11, "kind": "element", "displayName": "Script", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The script to execute that creates the bean when using scripting languages. If the script use the prefix resource: such as resource:classpath:com\/foo\/myscript.groovy, resource:file:\/var\/myscript.groovy, then its loaded from the ex [...] - } -} diff --git a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties index d1ab490245e..e58e8efc4ee 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties +++ b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties @@ -191,7 +191,6 @@ swiftMt swiftMx syslog tarFile -templateBean templateParameter templatedRoute templatedRouteBean diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index b/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index index 895ec8d7c0a..551d455421c 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index +++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index @@ -70,7 +70,6 @@ RouteConfigurationDefinition RouteConfigurationsDefinition RouteContextRefDefinition RouteDefinition -RouteTemplateBeanDefinition RouteTemplateContextRefDefinition RouteTemplateDefinition RouteTemplateParameterDefinition diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteTemplateBeanDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/RouteTemplateBeanDefinition.java deleted file mode 100644 index d72e31ee43b..00000000000 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteTemplateBeanDefinition.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.model; - -import jakarta.xml.bind.annotation.XmlAccessType; -import jakarta.xml.bind.annotation.XmlAccessorType; -import jakarta.xml.bind.annotation.XmlRootElement; - -import org.apache.camel.spi.Metadata; - -/** - * A route template bean (local bean) - */ -@Metadata(label = "configuration") -@XmlRootElement(name = "templateBean") -@XmlAccessorType(XmlAccessType.FIELD) -@Deprecated -public class RouteTemplateBeanDefinition - extends BeanFactoryDefinition<RouteTemplateBeanDefinition, RouteTemplateDefinition> { -} 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 ab5f821a711..c48f006aaaf 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 @@ -894,43 +894,6 @@ public class ModelParser extends BaseParser { default: yield optionalIdentifiedDefinitionAttributeHandler().accept(def, key, val); }, optionalIdentifiedDefinitionElementHandler(), noValueHandler()); } - protected RouteTemplateBeanDefinition doParseRouteTemplateBeanDefinition() throws IOException, XmlPullParserException { - return doParse(new RouteTemplateBeanDefinition(), beanFactoryDefinitionAttributeHandler(), beanFactoryDefinitionElementHandler(), noValueHandler()); - } - protected <T extends BeanFactoryDefinition> AttributeHandler<T> beanFactoryDefinitionAttributeHandler() { - return (def, key, val) -> switch (key) { - case "builderClass": def.setBuilderClass(val); yield true; - case "builderMethod": def.setBuilderMethod(val); yield true; - case "destroyMethod": def.setDestroyMethod(val); yield true; - case "factoryBean": def.setFactoryBean(val); yield true; - case "factoryMethod": def.setFactoryMethod(val); yield true; - case "initMethod": def.setInitMethod(val); yield true; - case "name": def.setName(val); yield true; - case "scriptLanguage": def.setScriptLanguage(val); yield true; - case "type": def.setType(val); yield true; - default: yield false; - }; - } - protected <T extends BeanFactoryDefinition> ElementHandler<T> beanFactoryDefinitionElementHandler() { - return (def, key) -> switch (key) { - case "constructors": def.setConstructors(new BeanConstructorsAdapter().unmarshal(doParseBeanConstructorsDefinition())); yield true; - case "properties": def.setProperties(new BeanPropertiesAdapter().unmarshal(doParseBeanPropertiesDefinition())); yield true; - case "script": def.setScript(doParseText()); yield true; - default: yield false; - }; - } - protected BeanConstructorsDefinition doParseBeanConstructorsDefinition() throws IOException, XmlPullParserException { - return doParse(new BeanConstructorsDefinition(), noAttributeHandler(), (def, key) -> switch (key) { - case "constructor": doAdd(doParseBeanConstructorDefinition(), def.getConstructors(), def::setConstructors); yield true; - default: yield false; - }, noValueHandler()); - } - protected BeanPropertiesDefinition doParseBeanPropertiesDefinition() throws IOException, XmlPullParserException { - return doParse(new BeanPropertiesDefinition(), noAttributeHandler(), (def, key) -> switch (key) { - case "property": doAdd(doParseBeanPropertyDefinition(), def.getProperties(), def::setProperties); yield true; - default: yield false; - }, noValueHandler()); - } protected RouteTemplateContextRefDefinition doParseRouteTemplateContextRefDefinition() throws IOException, XmlPullParserException { return doParse(new RouteTemplateContextRefDefinition(), (def, key, val) -> switch (key) { case "ref": def.setRef(val); yield true; @@ -1118,6 +1081,40 @@ public class ModelParser extends BaseParser { protected TemplatedRouteBeanDefinition doParseTemplatedRouteBeanDefinition() throws IOException, XmlPullParserException { return doParse(new TemplatedRouteBeanDefinition(), beanFactoryDefinitionAttributeHandler(), beanFactoryDefinitionElementHandler(), noValueHandler()); } + protected <T extends BeanFactoryDefinition> AttributeHandler<T> beanFactoryDefinitionAttributeHandler() { + return (def, key, val) -> switch (key) { + case "builderClass": def.setBuilderClass(val); yield true; + case "builderMethod": def.setBuilderMethod(val); yield true; + case "destroyMethod": def.setDestroyMethod(val); yield true; + case "factoryBean": def.setFactoryBean(val); yield true; + case "factoryMethod": def.setFactoryMethod(val); yield true; + case "initMethod": def.setInitMethod(val); yield true; + case "name": def.setName(val); yield true; + case "scriptLanguage": def.setScriptLanguage(val); yield true; + case "type": def.setType(val); yield true; + default: yield false; + }; + } + protected <T extends BeanFactoryDefinition> ElementHandler<T> beanFactoryDefinitionElementHandler() { + return (def, key) -> switch (key) { + case "constructors": def.setConstructors(new BeanConstructorsAdapter().unmarshal(doParseBeanConstructorsDefinition())); yield true; + case "properties": def.setProperties(new BeanPropertiesAdapter().unmarshal(doParseBeanPropertiesDefinition())); yield true; + case "script": def.setScript(doParseText()); yield true; + default: yield false; + }; + } + protected BeanConstructorsDefinition doParseBeanConstructorsDefinition() throws IOException, XmlPullParserException { + return doParse(new BeanConstructorsDefinition(), noAttributeHandler(), (def, key) -> switch (key) { + case "constructor": doAdd(doParseBeanConstructorDefinition(), def.getConstructors(), def::setConstructors); yield true; + default: yield false; + }, noValueHandler()); + } + protected BeanPropertiesDefinition doParseBeanPropertiesDefinition() throws IOException, XmlPullParserException { + return doParse(new BeanPropertiesDefinition(), noAttributeHandler(), (def, key) -> switch (key) { + case "property": doAdd(doParseBeanPropertyDefinition(), def.getProperties(), def::setProperties); yield true; + default: yield false; + }, noValueHandler()); + } protected TemplatedRouteDefinition doParseTemplatedRouteDefinition() throws IOException, XmlPullParserException { return doParse(new TemplatedRouteDefinition(), (def, key, val) -> switch (key) { case "prefixId": def.setPrefixId(val); yield true; 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 fd0e25c72da..11d23552707 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 @@ -243,9 +243,6 @@ public class ModelWriter extends BaseWriter { public void writeRouteDefinition(RouteDefinition def) throws IOException { doWriteRouteDefinition("route", def); } - public void writeRouteTemplateBeanDefinition(RouteTemplateBeanDefinition def) throws IOException { - doWriteRouteTemplateBeanDefinition("templateBean", def); - } public void writeRouteTemplateContextRefDefinition(RouteTemplateContextRefDefinition def) throws IOException { doWriteRouteTemplateContextRefDefinition("routeTemplateContextRef", def); } @@ -1566,12 +1563,6 @@ public class ModelWriter extends BaseWriter { doWriteList(null, null, def.getOutputs(), this::doWriteProcessorDefinitionRef); endElement(name); } - protected void doWriteRouteTemplateBeanDefinition(String name, RouteTemplateBeanDefinition def) throws IOException { - startElement(name); - doWriteBeanFactoryDefinitionAttributes(def); - doWriteBeanFactoryDefinitionElements(def); - endElement(name); - } protected void doWriteRouteTemplateContextRefDefinition(String name, RouteTemplateContextRefDefinition def) throws IOException { startElement(name); doWriteAttribute("ref", def.getRef()); 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 befc857d865..fd3e89c23d8 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 @@ -243,9 +243,6 @@ public class ModelWriter extends BaseWriter { public void writeRouteDefinition(RouteDefinition def) throws IOException { doWriteRouteDefinition("route", def); } - public void writeRouteTemplateBeanDefinition(RouteTemplateBeanDefinition def) throws IOException { - doWriteRouteTemplateBeanDefinition("templateBean", def); - } public void writeRouteTemplateContextRefDefinition(RouteTemplateContextRefDefinition def) throws IOException { doWriteRouteTemplateContextRefDefinition("routeTemplateContextRef", def); } @@ -1566,12 +1563,6 @@ public class ModelWriter extends BaseWriter { doWriteList(null, null, def.getOutputs(), this::doWriteProcessorDefinitionRef); endElement(name); } - protected void doWriteRouteTemplateBeanDefinition(String name, RouteTemplateBeanDefinition def) throws IOException { - startElement(name); - doWriteBeanFactoryDefinitionAttributes(def); - doWriteBeanFactoryDefinitionElements(def); - endElement(name); - } protected void doWriteRouteTemplateContextRefDefinition(String name, RouteTemplateContextRefDefinition def) throws IOException { startElement(name); doWriteAttribute("ref", def.getRef()); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/CustomResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/CustomResolver.java index 6cd4b1199f5..937a93d54dc 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/CustomResolver.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/CustomResolver.java @@ -65,8 +65,6 @@ public class CustomResolver implements YamlDeserializerResolver { case "templatedRoute": case "org.apache.camel.model.TemplatedRouteDefinition": return new TemplatedRouteDefinitionDeserializer(); - case "org.apache.camel.model.RouteTemplateBeanDefinition": - return new RouteTemplateBeanDefinitionDeserializer(); case "org.apache.camel.model.TemplatedRouteBeanDefinition": return new TemplatedRouteBeanDefinitionDeserializer(); case "org.apache.camel.dsl.yaml.deserializers.OutputAwareFromDefinition": diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/RouteTemplateBeanDefinitionDeserializer.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/RouteTemplateBeanDefinitionDeserializer.java deleted file mode 100644 index a2a9ad856d3..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/RouteTemplateBeanDefinitionDeserializer.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml.deserializers; - -import org.apache.camel.dsl.yaml.common.YamlDeserializerResolver; -import org.apache.camel.model.RouteTemplateBeanDefinition; -import org.apache.camel.spi.annotations.YamlProperty; -import org.apache.camel.spi.annotations.YamlType; - -/** - * The YAML deserializer for the bean factory used by the route template. - */ -@YamlType( - inline = false, - types = org.apache.camel.model.RouteTemplateBeanDefinition.class, - order = YamlDeserializerResolver.ORDER_DEFAULT, - nodes = { "template-bean", "templateBean" }, - properties = { - @YamlProperty(name = "name", type = "string", required = true), - @YamlProperty(name = "type", type = "string", required = true), - @YamlProperty(name = "constructors", type = "object"), - @YamlProperty(name = "properties", type = "object"), - @YamlProperty(name = "initMethod", type = "string"), - @YamlProperty(name = "destroyMethod", type = "string"), - @YamlProperty(name = "factoryMethod", type = "string"), - @YamlProperty(name = "factoryBean", type = "string"), - @YamlProperty(name = "builderClass", type = "string"), - @YamlProperty(name = "builderMethod", type = "string"), - @YamlProperty(name = "scriptLanguage", type = "string"), - @YamlProperty(name = "script", type = "string") - }) -public class RouteTemplateBeanDefinitionDeserializer extends BeanFactoryDefinitionDeserializer<RouteTemplateBeanDefinition> { - - public RouteTemplateBeanDefinitionDeserializer() { - super(RouteTemplateBeanDefinition.class); - } - - @Override - protected RouteTemplateBeanDefinition newInstance() { - return new RouteTemplateBeanDefinition(); - } - - @Override - protected RouteTemplateBeanDefinition newInstance(String value) { - RouteTemplateBeanDefinition answer = new RouteTemplateBeanDefinition(); - answer.setName(value); - return answer; - } -} 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 2532c162d92..1d5df7fc101 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 @@ -5187,49 +5187,6 @@ }, "required" : [ "from" ] }, - "org.apache.camel.model.RouteTemplateBeanDefinition" : { - "type" : "object", - "additionalProperties" : false, - "properties" : { - "builderClass" : { - "type" : "string" - }, - "builderMethod" : { - "type" : "string" - }, - "constructors" : { - "type" : "object" - }, - "destroyMethod" : { - "type" : "string" - }, - "factoryBean" : { - "type" : "string" - }, - "factoryMethod" : { - "type" : "string" - }, - "initMethod" : { - "type" : "string" - }, - "name" : { - "type" : "string" - }, - "properties" : { - "type" : "object" - }, - "script" : { - "type" : "string" - }, - "scriptLanguage" : { - "type" : "string" - }, - "type" : { - "type" : "string" - } - }, - "required" : [ "name", "type" ] - }, "org.apache.camel.model.RouteTemplateDefinition" : { "type" : "object", "additionalProperties" : false,