You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/01/03 11:51:49 UTC
[1/3] camel git commit: Component docs - Allow to explict specify
javaType of UriPath/UriParam property to specify the preferred type to use
Repository: camel
Updated Branches:
refs/heads/camel-2.16.x 0cdce29ab -> 367eb6573
refs/heads/master ef9e179a5 -> 1e5bc2487
Component docs - Allow to explict specify javaType of UriPath/UriParam property to specify the preferred type to use
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1e5bc248
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1e5bc248
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1e5bc248
Branch: refs/heads/master
Commit: 1e5bc2487cd83661ec2e7d6640bdd0706ad1fe21
Parents: ef9e179
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 3 11:48:38 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 3 11:48:38 2016 +0100
----------------------------------------------------------------------
.../camel/component/file/GenericFileEndpoint.java | 17 +++++++++--------
.../tools/apt/EndpointAnnotationProcessor.java | 9 +++++++++
.../main/java/org/apache/camel/spi/UriParam.java | 7 +++++++
.../main/java/org/apache/camel/spi/UriPath.java | 7 +++++++
4 files changed, 32 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1e5bc248/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 160fc9f..52d2af1 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -42,6 +42,7 @@ import org.apache.camel.spi.ExceptionHandler;
import org.apache.camel.spi.FactoryFinder;
import org.apache.camel.spi.IdempotentRepository;
import org.apache.camel.spi.Language;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.IOHelper;
@@ -73,7 +74,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected int bufferSize = FileUtil.BUFFER_SIZE;
@UriParam
protected String charset;
- @UriParam
+ @UriParam(javaType = "java.lang.String")
protected Expression fileName;
// producer options
@@ -84,7 +85,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected GenericFileExist fileExist = GenericFileExist.Override;
@UriParam(label = "producer")
protected String tempPrefix;
- @UriParam(label = "producer")
+ @UriParam(label = "producer", javaType = "java.lang.String")
protected Expression tempFileName;
@UriParam(label = "producer,advanced", defaultValue = "true")
protected boolean eagerDeleteTargetFile = true;
@@ -129,17 +130,17 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected String include;
@UriParam(label = "consumer,filter")
protected String exclude;
- @UriParam(label = "consumer,filter")
+ @UriParam(label = "consumer,filter", javaType = "java.lang.String")
protected Expression move;
- @UriParam(label = "consumer")
+ @UriParam(label = "consumer", javaType = "java.lang.String")
protected Expression moveFailed;
- @UriParam(label = "consumer")
+ @UriParam(label = "consumer", javaType = "java.lang.String")
protected Expression preMove;
- @UriParam(label = "producer")
+ @UriParam(label = "producer", javaType = "java.lang.String")
protected Expression moveExisting;
@UriParam(label = "consumer,filter", defaultValue = "false")
protected Boolean idempotent;
- @UriParam(label = "consumer,filter")
+ @UriParam(label = "consumer,filter", javaType = "java.lang.String")
protected Expression idempotentKey;
@UriParam(label = "consumer,filter")
protected IdempotentRepository<String> idempotentRepository;
@@ -154,7 +155,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected String antExclude;
@UriParam(label = "consumer,sort")
protected Comparator<GenericFile<T>> sorter;
- @UriParam(label = "consumer,sort")
+ @UriParam(label = "consumer,sort", javaType = "java.lang.String")
protected Comparator<Exchange> sortBy;
@UriParam(label = "consumer,sort")
protected boolean shuffle;
http://git-wip-us.apache.org/repos/asf/camel/blob/1e5bc248/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 1f4025a..fc55db8 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -646,6 +646,11 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor {
}
}
+ // the field type may be overloaded by another type
+ if (!Strings.isNullOrEmpty(path.javaType())) {
+ fieldTypeName = path.javaType();
+ }
+
String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
EndpointPath ep = new EndpointPath(name, fieldTypeName, required, defaultValue, docComment, deprecated, group, label, isEnum, enums);
endpointPaths.add(ep);
@@ -717,6 +722,10 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor {
}
}
+ // the field type may be overloaded by another type
+ if (!Strings.isNullOrEmpty(param.javaType())) {
+ fieldTypeName = param.javaType();
+ }
String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
EndpointOption option = new EndpointOption(name, fieldTypeName, required, defaultValue, defaultValueNote,
http://git-wip-us.apache.org/repos/asf/camel/blob/1e5bc248/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
index 13e067d..59e4bcd 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
@@ -77,4 +77,11 @@ public @interface UriParam {
*/
String label() default "";
+ /**
+ * To re-associate the preferred Java type of this parameter.
+ * <p/>
+ * This is used for parameters which are of a specialized type but can be configured by another Java type, such as from a String.
+ */
+ String javaType() default "";
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/1e5bc248/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
index 8432509..23dac1f 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
@@ -79,4 +79,11 @@ public @interface UriPath {
*/
String label() default "";
+ /**
+ * To re-associate the preferred Java type of this parameter.
+ * <p/>
+ * This is used for parameters which are of a specialized type but can be configured by another Java type, such as from a String.
+ */
+ String javaType() default "";
+
}
\ No newline at end of file
[2/3] camel git commit: CAMEL-9469: Properties component - Should
include component docs
Posted by da...@apache.org.
CAMEL-9469: Properties component - Should include component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/294bb237
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/294bb237
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/294bb237
Branch: refs/heads/camel-2.16.x
Commit: 294bb237ab7937fea81f9be19f331e8c340092ce
Parents: 0cdce29
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 3 10:41:19 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 3 11:51:33 2016 +0100
----------------------------------------------------------------------
.../properties/PropertiesComponent.java | 44 ++++++-
.../properties/PropertiesEndpoint.java | 119 +++++++++++++++++++
2 files changed, 158 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/294bb237/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java b/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
index 952606c..b0bd45c 100644
--- a/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Properties;
import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.impl.UriEndpointComponent;
import org.apache.camel.util.FilePathResolver;
import org.apache.camel.util.LRUSoftCache;
import org.apache.camel.util.ObjectHelper;
@@ -34,10 +34,8 @@ import org.slf4j.LoggerFactory;
/**
* The <a href="http://camel.apache.org/properties">Properties Component</a> allows you to use property placeholders when defining Endpoint URIs
- *
- * @version
*/
-public class PropertiesComponent extends DefaultComponent {
+public class PropertiesComponent extends UriEndpointComponent {
/**
* The default prefix token.
@@ -108,6 +106,7 @@ public class PropertiesComponent extends DefaultComponent {
private int systemPropertiesMode = SYSTEM_PROPERTIES_MODE_OVERRIDE;
public PropertiesComponent() {
+ super(PropertiesEndpoint.class);
// include out of the box functions
addFunction(new EnvPropertiesFunction());
addFunction(new SysPropertiesFunction());
@@ -143,7 +142,12 @@ public class PropertiesComponent extends DefaultComponent {
String endpointUri = parseUri(remaining, paths);
LOG.debug("Endpoint uri parsed as: {}", endpointUri);
- return getCamelContext().getEndpoint(endpointUri);
+
+ Endpoint delegate = getCamelContext().getEndpoint(endpointUri);
+ PropertiesEndpoint answer = new PropertiesEndpoint(uri, delegate, this);
+
+ setProperties(answer, parameters);
+ return answer;
}
public String parseUri(String uri) throws Exception {
@@ -214,6 +218,10 @@ public class PropertiesComponent extends DefaultComponent {
return locations;
}
+ /**
+ * A list of locations to load properties. You can use comma to separate multiple locations.
+ * This option will override any default locations and only use the locations from this option.
+ */
public void setLocations(String[] locations) {
// make sure to trim as people may use new lines when configuring using XML
// and do this in the setter as Spring/Blueprint resolves placeholders before Camel is being started
@@ -227,6 +235,10 @@ public class PropertiesComponent extends DefaultComponent {
this.locations = locations;
}
+ /**
+ * A list of locations to load properties. You can use comma to separate multiple locations.
+ * This option will override any default locations and only use the locations from this option.
+ */
public void setLocation(String location) {
setLocations(location.split(","));
}
@@ -249,6 +261,9 @@ public class PropertiesComponent extends DefaultComponent {
return propertiesResolver;
}
+ /**
+ * To use a custom PropertiesResolver
+ */
public void setPropertiesResolver(PropertiesResolver propertiesResolver) {
this.propertiesResolver = propertiesResolver;
}
@@ -257,6 +272,9 @@ public class PropertiesComponent extends DefaultComponent {
return propertiesParser;
}
+ /**
+ * To use a custom PropertiesParser
+ */
public void setPropertiesParser(PropertiesParser propertiesParser) {
this.propertiesParser = propertiesParser;
}
@@ -265,6 +283,9 @@ public class PropertiesComponent extends DefaultComponent {
return cache;
}
+ /**
+ * Whether or not to cache loaded properties. The default value is true.
+ */
public void setCache(boolean cache) {
this.cache = cache;
}
@@ -273,6 +294,9 @@ public class PropertiesComponent extends DefaultComponent {
return propertyPrefix;
}
+ /**
+ * Optional prefix prepended to property names before resolution.
+ */
public void setPropertyPrefix(String propertyPrefix) {
this.propertyPrefix = propertyPrefix;
this.propertyPrefixResolved = propertyPrefix;
@@ -285,6 +309,9 @@ public class PropertiesComponent extends DefaultComponent {
return propertySuffix;
}
+ /**
+ * Optional suffix appended to property names before resolution.
+ */
public void setPropertySuffix(String propertySuffix) {
this.propertySuffix = propertySuffix;
this.propertySuffixResolved = propertySuffix;
@@ -297,6 +324,10 @@ public class PropertiesComponent extends DefaultComponent {
return fallbackToUnaugmentedProperty;
}
+ /**
+ * If true, first attempt resolution of property name augmented with propertyPrefix and propertySuffix
+ * before falling back the plain property name specified. If false, only the augmented property name is searched.
+ */
public void setFallbackToUnaugmentedProperty(boolean fallbackToUnaugmentedProperty) {
this.fallbackToUnaugmentedProperty = fallbackToUnaugmentedProperty;
}
@@ -305,6 +336,9 @@ public class PropertiesComponent extends DefaultComponent {
return ignoreMissingLocation;
}
+ /**
+ * Whether to silently ignore if a location cannot be located, such as a properties file not found.
+ */
public void setIgnoreMissingLocation(boolean ignoreMissingLocation) {
this.ignoreMissingLocation = ignoreMissingLocation;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/294bb237/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesEndpoint.java
new file mode 100644
index 0000000..e9837a6
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesEndpoint.java
@@ -0,0 +1,119 @@
+/**
+ * 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.component.properties;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.DelegateEndpoint;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+
+/**
+ * The properties component is used for using property placeholders in endpoint uris.
+ */
+@UriEndpoint(scheme = "properties", title = "Properties", syntax = "properties:key", label = "core,endpoint")
+public class PropertiesEndpoint extends DefaultEndpoint implements DelegateEndpoint {
+
+ private volatile Endpoint endpoint;
+
+ @UriPath
+ @Metadata(required = "true")
+ private String key;
+ @UriParam
+ private String locations;
+ @UriParam
+ private boolean ignoreMissingLocation;
+
+ public PropertiesEndpoint(String endpointUri, Endpoint delegate, Component component) {
+ super(endpointUri, component);
+ this.endpoint = delegate;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Property key to use as placeholder
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getLocations() {
+ return locations;
+ }
+
+ /**
+ * A list of locations to load properties. You can use comma to separate multiple locations.
+ * This option will override any default locations and only use the locations from this option.
+ */
+ public void setLocations(String locations) {
+ this.locations = locations;
+ }
+
+ public boolean isIgnoreMissingLocation() {
+ return ignoreMissingLocation;
+ }
+
+ /**
+ * Whether to silently ignore if a location cannot be located, such as a properties file not found.
+ */
+ public void setIgnoreMissingLocation(boolean ignoreMissingLocation) {
+ this.ignoreMissingLocation = ignoreMissingLocation;
+ }
+
+ @Override
+ public Producer createProducer() throws Exception {
+ return endpoint.createProducer();
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ return endpoint.createConsumer(processor);
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return true;
+ }
+
+ @Override
+ public Endpoint getEndpoint() {
+ return endpoint;
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ // add the endpoint as a service so Camel can manage the endpoint and enlist the endpoint in JMX etc.
+ getCamelContext().addService(endpoint);
+ super.doStart();
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ super.doStop();
+ // noop
+ }
+
+}
[3/3] camel git commit: Component docs - Allow to explict specify
javaType of UriPath/UriParam property to specify the preferred type to use
Posted by da...@apache.org.
Component docs - Allow to explict specify javaType of UriPath/UriParam property to specify the preferred type to use
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/367eb657
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/367eb657
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/367eb657
Branch: refs/heads/camel-2.16.x
Commit: 367eb6573c6078682c570a3c2a2c58c67d888c39
Parents: 294bb23
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 3 11:48:38 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 3 11:51:40 2016 +0100
----------------------------------------------------------------------
.../camel/component/file/GenericFileEndpoint.java | 17 +++++++++--------
.../tools/apt/EndpointAnnotationProcessor.java | 9 +++++++++
.../main/java/org/apache/camel/spi/UriParam.java | 7 +++++++
.../main/java/org/apache/camel/spi/UriPath.java | 7 +++++++
4 files changed, 32 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/367eb657/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 434af2f..9e13726 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -42,6 +42,7 @@ import org.apache.camel.spi.ExceptionHandler;
import org.apache.camel.spi.FactoryFinder;
import org.apache.camel.spi.IdempotentRepository;
import org.apache.camel.spi.Language;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.IOHelper;
@@ -73,7 +74,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected int bufferSize = FileUtil.BUFFER_SIZE;
@UriParam
protected String charset;
- @UriParam
+ @UriParam(javaType = "java.lang.String")
protected Expression fileName;
// producer options
@@ -84,7 +85,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected GenericFileExist fileExist = GenericFileExist.Override;
@UriParam(label = "producer")
protected String tempPrefix;
- @UriParam(label = "producer")
+ @UriParam(label = "producer", javaType = "java.lang.String")
protected Expression tempFileName;
@UriParam(label = "producer,advanced", defaultValue = "true")
protected boolean eagerDeleteTargetFile = true;
@@ -129,17 +130,17 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected String include;
@UriParam(label = "consumer,filter")
protected String exclude;
- @UriParam(label = "consumer,filter")
+ @UriParam(label = "consumer,filter", javaType = "java.lang.String")
protected Expression move;
- @UriParam(label = "consumer")
+ @UriParam(label = "consumer", javaType = "java.lang.String")
protected Expression moveFailed;
- @UriParam(label = "consumer")
+ @UriParam(label = "consumer", javaType = "java.lang.String")
protected Expression preMove;
- @UriParam(label = "producer")
+ @UriParam(label = "producer", javaType = "java.lang.String")
protected Expression moveExisting;
@UriParam(label = "consumer,filter", defaultValue = "false")
protected Boolean idempotent;
- @UriParam(label = "consumer,filter")
+ @UriParam(label = "consumer,filter", javaType = "java.lang.String")
protected Expression idempotentKey;
@UriParam(label = "consumer,filter")
protected IdempotentRepository<String> idempotentRepository;
@@ -154,7 +155,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
protected String antExclude;
@UriParam(label = "consumer,sort")
protected Comparator<GenericFile<T>> sorter;
- @UriParam(label = "consumer,sort")
+ @UriParam(label = "consumer,sort", javaType = "java.lang.String")
protected Comparator<Exchange> sortBy;
@UriParam(label = "consumer,sort")
protected boolean shuffle;
http://git-wip-us.apache.org/repos/asf/camel/blob/367eb657/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index e662217..a8304b3 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -636,6 +636,11 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor {
}
}
+ // the field type may be overloaded by another type
+ if (!Strings.isNullOrEmpty(path.javaType())) {
+ fieldTypeName = path.javaType();
+ }
+
String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
EndpointPath ep = new EndpointPath(name, fieldTypeName, required, defaultValue, docComment, deprecated, group, label, isEnum, enums);
endpointPaths.add(ep);
@@ -707,6 +712,10 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor {
}
}
+ // the field type may be overloaded by another type
+ if (!Strings.isNullOrEmpty(param.javaType())) {
+ fieldTypeName = param.javaType();
+ }
String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
EndpointOption option = new EndpointOption(name, fieldTypeName, required, defaultValue, defaultValueNote,
http://git-wip-us.apache.org/repos/asf/camel/blob/367eb657/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
index 13e067d..59e4bcd 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
@@ -77,4 +77,11 @@ public @interface UriParam {
*/
String label() default "";
+ /**
+ * To re-associate the preferred Java type of this parameter.
+ * <p/>
+ * This is used for parameters which are of a specialized type but can be configured by another Java type, such as from a String.
+ */
+ String javaType() default "";
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/367eb657/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
index 8432509..23dac1f 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
@@ -79,4 +79,11 @@ public @interface UriPath {
*/
String label() default "";
+ /**
+ * To re-associate the preferred Java type of this parameter.
+ * <p/>
+ * This is used for parameters which are of a specialized type but can be configured by another Java type, such as from a String.
+ */
+ String javaType() default "";
+
}
\ No newline at end of file