camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/5] camel git commit: CAMEL-7999: Add defaultValue to @UriParam
Date Sun, 09 Nov 2014 10:18:52 GMT
CAMEL-7999: Add defaultValue to @UriParam


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/03dd3cc0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/03dd3cc0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/03dd3cc0

Branch: refs/heads/master
Commit: 03dd3cc0a6b5d5604f17cfaeb3424433a39b7ef9
Parents: 8212442
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Nov 9 10:54:30 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Nov 9 10:54:30 2014 +0100

----------------------------------------------------------------------
 .../camel/component/bean/BeanEndpoint.java      |  4 +--
 .../controlbus/ControlBusEndpoint.java          |  4 +--
 .../component/dataset/DataSetEndpoint.java      | 10 +++---
 .../camel/component/direct/DirectEndpoint.java  |  4 +--
 .../component/directvm/DirectVmEndpoint.java    |  4 +--
 .../camel/component/file/FileEndpoint.java      |  6 ++--
 .../component/file/GenericFileEndpoint.java     | 38 ++++++++++----------
 .../component/language/LanguageEndpoint.java    |  8 ++---
 .../camel/component/seda/SedaEndpoint.java      | 16 ++++-----
 .../camel/component/test/TestEndpoint.java      |  2 +-
 .../camel/component/timer/TimerEndpoint.java    | 10 +++---
 .../camel/component/xslt/XsltEndpoint.java      |  2 +-
 .../org/apache/camel/impl/DefaultEndpoint.java  |  4 +--
 .../tools/apt/EndpointAnnotationProcessor.java  | 21 +++++------
 .../camel/tools/apt/JsonSchemaHelper.java       |  7 +++-
 .../java/org/apache/camel/spi/UriParam.java     |  4 +--
 16 files changed, 75 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
index c6933ae..cdb770f 100644
--- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
@@ -31,9 +31,9 @@ import org.apache.camel.spi.UriParam;
 @UriEndpoint(scheme = "bean")
 public class BeanEndpoint extends ProcessorEndpoint {
     private BeanHolder beanHolder;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean cache;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean multiParameterArray;
     @UriParam
     private String beanName;

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java
index daacd7c..f1fd3df 100644
--- a/camel-core/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java
@@ -39,9 +39,9 @@ public class ControlBusEndpoint extends DefaultEndpoint {
     private String routeId;
     @UriParam
     private String action;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean async;
-    @UriParam
+    @UriParam(defaultValue = "INFO")
     private LoggingLevel loggingLevel = LoggingLevel.INFO;
 
     public ControlBusEndpoint(String endpointUri, Component component) {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
index 6999452..57f30fe 100644
--- a/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
@@ -45,15 +45,15 @@ public class DataSetEndpoint extends MockEndpoint implements Service {
     private final transient Logger log;
     private volatile DataSet dataSet;
     private final AtomicInteger receivedCounter = new AtomicInteger();
-    @UriParam
+    @UriParam(defaultValue = "0")
     private int minRate;
-    @UriParam
+    @UriParam(defaultValue = "3")
     private long produceDelay = 3;
-    @UriParam
+    @UriParam(defaultValue = "0")
     private long consumeDelay;
-    @UriParam
+    @UriParam(defaultValue = "0")
     private long preloadSize;
-    @UriParam
+    @UriParam(defaultValue = "1000")
     private long initialDelay = 1000;
 
     @Deprecated

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
index 855f275..fa59de6 100644
--- a/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
@@ -38,9 +38,9 @@ import org.apache.camel.util.ObjectHelper;
 public class DirectEndpoint extends DefaultEndpoint {
 
     private volatile Map<String, DirectConsumer> consumers;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean block;
-    @UriParam
+    @UriParam(defaultValue = "30000")
     private long timeout = 30000L;
 
     public DirectEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmEndpoint.java
index 9a090b5..e8af675 100644
--- a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmEndpoint.java
@@ -30,9 +30,9 @@ import org.apache.camel.spi.UriParam;
 @UriEndpoint(scheme = "direct-vm", consumerClass = DirectConsumer.class)
 public class DirectVmEndpoint extends DefaultEndpoint {
 
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean block;
-    @UriParam
+    @UriParam(defaultValue = "30000")
     private long timeout = 30000L;
 
     public DirectVmEndpoint(String endpointUri, DirectVmComponent component) {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
index 4e0a920..4177f5d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
@@ -38,11 +38,11 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
     private final FileOperations operations = new FileOperations(this);
     @UriPath
     private File file;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean copyAndDeleteOnRenameFail = true;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean renameUsingCopy;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean forceWrites = true;
 
     public FileEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/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 b3e96e7..0f0c424 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
@@ -72,29 +72,29 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint
imple
     protected IdempotentRepository<String> inProgressRepository = new MemoryIdempotentRepository();
     @UriParam
     protected String localWorkDirectory;
-    @UriParam
+    @UriParam(defaultValue = "true")
     protected boolean autoCreate = true;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean startingDirectoryMustExist;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean directoryMustExist;
-    @UriParam
+    @UriParam(defaultValue = "" + FileUtil.BUFFER_SIZE)
     protected int bufferSize = FileUtil.BUFFER_SIZE;
-    @UriParam
+    @UriParam(defaultValue = "Override")
     protected GenericFileExist fileExist = GenericFileExist.Override;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean noop;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean recursive;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean delete;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean flatten;
     @UriParam
     protected int maxMessagesPerPoll;
-    @UriParam
+    @UriParam(defaultValue = "true")
     protected boolean eagerMaxMessagesPerPoll = true;
-    @UriParam
+    @UriParam(defaultValue = "" + Integer.MAX_VALUE)
     protected int maxDepth = Integer.MAX_VALUE;
     @UriParam
     protected int minDepth;
@@ -102,7 +102,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint
imple
     protected String tempPrefix;
     @UriParam
     protected Expression tempFileName;
-    @UriParam
+    @UriParam(defaultValue = "true")
     protected boolean eagerDeleteTargetFile = true;
     @UriParam
     protected String include;
@@ -136,23 +136,23 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint
imple
     protected Comparator<Exchange> sortBy;
     @UriParam
     protected String readLock = "none";
-    @UriParam
+    @UriParam(defaultValue = "1000")
     protected long readLockCheckInterval = 1000;
-    @UriParam
+    @UriParam(defaultValue = "10000")
     protected long readLockTimeout = 10000;
-    @UriParam
+    @UriParam(defaultValue = "true")
     protected boolean readLockMarkerFile = true;
-    @UriParam
+    @UriParam(defaultValue = "WARN")
     protected LoggingLevel readLockLoggingLevel = LoggingLevel.WARN;
-    @UriParam
+    @UriParam(defaultValue = "1")
     protected long readLockMinLength = 1;
     @UriParam
     protected GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean keepLastModified;
     @UriParam
     protected String doneFileName;
-    @UriParam
+    @UriParam(defaultValue = "false")
     protected boolean allowNullBody;
     @UriParam
     protected String chmod;

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java
index 71261ff..3701149 100644
--- a/camel-core/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java
@@ -48,13 +48,13 @@ public class LanguageEndpoint extends ResourceEndpoint {
     private String languageName;
     @UriParam
     private String script;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean transform = true;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean binary;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean contentResolvedFromResource;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean cacheScript;
 
     public LanguageEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
index f6e3843..f5043fa 100644
--- a/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
@@ -63,21 +63,21 @@ public class SedaEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
     private volatile MulticastProcessor consumerMulticastProcessor;
     private volatile boolean multicastStarted;
     private volatile ExecutorService multicastExecutor;
-    @UriParam
+    @UriParam(defaultValue = "" + Integer.MAX_VALUE)
     private int size = Integer.MAX_VALUE;
-    @UriParam
+    @UriParam(defaultValue = "1")
     private int concurrentConsumers = 1;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean multipleConsumers;
-    @UriParam
+    @UriParam(defaultValue = "IfReplyExpected")
     private WaitForTaskToComplete waitForTaskToComplete = WaitForTaskToComplete.IfReplyExpected;
-    @UriParam
+    @UriParam(defaultValue = "30000")
     private long timeout = 30000;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean blockWhenFull;
-    @UriParam
+    @UriParam(defaultValue = "1000")
     private int pollTimeout = 1000;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean purgeWhenStopping;
 
     @UriParam

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
index 62401ed..ce3c50d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
 public class TestEndpoint extends MockEndpoint {
     private static final Logger LOG = LoggerFactory.getLogger(TestEndpoint.class);
     private final Endpoint expectedMessageEndpoint;
-    @UriParam
+    @UriParam(defaultValue = "2000")
     private long timeout = 2000L;
 
     public TestEndpoint(String endpointUri, Component component, Endpoint expectedMessageEndpoint)
{

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
b/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
index 321167e..d2d6bb8 100644
--- a/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
@@ -43,17 +43,17 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS
     private String timerName;
     @UriParam
     private Date time;
-    @UriParam
+    @UriParam(defaultValue = "1000")
     private long period = 1000;
-    @UriParam
+    @UriParam(defaultValue = "1000")
     private long delay = 1000;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean fixedRate;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean daemon = true;
     @UriParam
     private Timer timer;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private long repeatCount;
 
     public TimerEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
index ea0fa26..003f2b6 100644
--- a/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
@@ -43,7 +43,7 @@ public class XsltEndpoint extends ProcessorEndpoint {
     private XsltBuilder xslt;
     @UriParam
     private String resourceUri;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean cacheStylesheet;
 
     public XsltEndpoint(String endpointUri, Component component, XsltBuilder xslt, String
resourceUri,

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
index 2a6c5b0..b5dba17 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
@@ -59,11 +59,11 @@ public abstract class DefaultEndpoint extends ServiceSupport implements
Endpoint
     private EndpointConfiguration endpointConfiguration;
     private CamelContext camelContext;
     private Component component;
-    @UriParam
+    @UriParam(defaultValue = "InOnly")
     private ExchangePattern exchangePattern = ExchangePattern.InOnly;
     // option to allow end user to dictate whether async processing should be
     // used or not (if possible)
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean synchronous;
     private final String id = EndpointHelper.createEndpointId();
     private Map<String, Object> consumerProperties;

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/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 7d90b1a..c825bf4 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
@@ -50,6 +50,7 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 
 import static org.apache.camel.tools.apt.Strings.canonicalClassName;
+import static org.apache.camel.tools.apt.Strings.isNullOrEmpty;
 
 /**
  * Processes all Camel {@link UriEndpoint}s and generate json schema and html documentation
for the endpoint/component.
@@ -74,7 +75,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
         final UriEndpoint uriEndpoint = classElement.getAnnotation(UriEndpoint.class);
         if (uriEndpoint != null) {
             String scheme = uriEndpoint.scheme();
-            if (!Strings.isNullOrEmpty(scheme)) {
+            if (!isNullOrEmpty(scheme)) {
                 // write html documentation
                 String name = canonicalClassName(classElement.getQualifiedName().toString());
                 String packageName = name.substring(0, name.lastIndexOf("."));
@@ -145,7 +146,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
         String scheme = uriEndpoint.scheme();
 
         String classDoc = processingEnv.getElementUtils().getDocComment(classElement);
-        if (!Strings.isNullOrEmpty(classDoc)) {
+        if (!isNullOrEmpty(classDoc)) {
             classDoc = JsonSchemaHelper.sanitizeDescription(classDoc);
         }
 
@@ -170,7 +171,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 buffer.append(",");
             }
             buffer.append("\n    ");
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getType(), entry.getDocumentation(),
entry.isEnumType(), entry.getEnums()));
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getType(), entry.getDefaultValue(),
entry.getDocumentationWithNotes(), entry.isEnumType(), entry.getEnums()));
         }
         buffer.append("\n  }\n}\n");
         return buffer.toString();
@@ -178,7 +179,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
 
     protected void showDocumentationAndFieldInjections(PrintWriter writer, RoundEnvironment
roundEnv, TypeElement classElement, String prefix) {
         String classDoc = processingEnv.getElementUtils().getDocComment(classElement);
-        if (!Strings.isNullOrEmpty(classDoc)) {
+        if (!isNullOrEmpty(classDoc)) {
             // remove dodgy @version that we may have in class javadoc
             classDoc = classDoc.replaceFirst("\\@version", "");
             classDoc = classDoc.trim();
@@ -219,7 +220,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 String fieldName = fieldElement.getSimpleName().toString();
                 if (param != null) {
                     String name = param.name();
-                    if (Strings.isNullOrEmpty(name)) {
+                    if (isNullOrEmpty(name)) {
                         name = fieldName;
                     }
                     name = prefix + name;
@@ -238,13 +239,13 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                     if (fieldParams != null) {
                         String nestedPrefix = prefix;
                         String extraPrefix = fieldParams.prefix();
-                        if (!Strings.isNullOrEmpty(extraPrefix)) {
+                        if (!isNullOrEmpty(extraPrefix)) {
                             nestedPrefix += extraPrefix;
                         }
                         findClassProperties(roundEnv, endpointOptions, fieldTypeElement,
nestedPrefix);
                     } else {
                         String docComment = elementUtils.getDocComment(fieldElement);
-                        if (Strings.isNullOrEmpty(docComment)) {
+                        if (isNullOrEmpty(docComment)) {
                             String setter = "set" + fieldName.substring(0, 1).toUpperCase();
                             if (fieldName.length() > 1) {
                                 setter += fieldName.substring(1);
@@ -255,7 +256,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                                 String methodName = method.getSimpleName().toString();
                                 if (setter.equals(methodName) && method.getParameters().size()
== 1) {
                                     String doc = elementUtils.getDocComment(method);
-                                    if (!Strings.isNullOrEmpty(doc)) {
+                                    if (!isNullOrEmpty(doc)) {
                                         docComment = doc;
                                         break;
                                     }
@@ -301,7 +302,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
     }
 
     protected TypeElement findTypeElement(RoundEnvironment roundEnv, String className) {
-        if (!Strings.isNullOrEmpty(className) && !"java.lang.Object".equals(className))
{
+        if (!isNullOrEmpty(className) && !"java.lang.Object".equals(className)) {
             Set<? extends Element> rootElements = roundEnv.getRootElements();
             for (Element rootElement : rootElements) {
                 if (rootElement instanceof TypeElement) {
@@ -415,7 +416,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
         }
 
         public String getDocumentationWithNotes() {
-            if (defaultValueNote != null) {
+            if (!isNullOrEmpty(defaultValueNote)) {
                 return documentation + ". Default value notice: " + defaultValueNote;
             }
             return documentation;

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java
index ba60328..f396bef 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/JsonSchemaHelper.java
@@ -26,7 +26,7 @@ final class JsonSchemaHelper {
     private JsonSchemaHelper() {
     }
 
-    public static String toJson(String name, String type, String description, boolean enumType,
Set<String> enums) {
+    public static String toJson(String name, String type, String defaultValue, String description,
boolean enumType, Set<String> enums) {
         String typeName = JsonSchemaHelper.getType(type, enumType);
 
         StringBuilder sb = new StringBuilder();
@@ -51,6 +51,11 @@ final class JsonSchemaHelper {
             sb.append(", \"javaType\": \"" + type + "\"");
         }
 
+        if (!Strings.isNullOrEmpty(defaultValue)) {
+            sb.append(", \"defaultValue\": ");
+            sb.append(Strings.doubleQuote(defaultValue));
+        }
+
         if (!Strings.isNullOrEmpty(description)) {
             sb.append(", \"description\": ");
             String text = sanitizeDescription(description);

http://git-wip-us.apache.org/repos/asf/camel/blob/03dd3cc0/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 5caac4c..2724999 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
@@ -42,13 +42,13 @@ public @interface UriParam {
      * <p/>
      * Note that this attribute is only for documentation purpose. The default value in use
at runtime is the value the Java field was assigned.
      */
-    String defaultValue();
+    String defaultValue() default "";
 
     /**
      * A special note about the default value.
      * <p/>
      * This can be used to document special cases about the default value.
      */
-    String defaultValueNote();
+    String defaultValueNote() default "";
 
 }
\ No newline at end of file


Mime
View raw message