You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dh...@apache.org on 2014/06/10 21:51:46 UTC

[18/35] git commit: Added getApiNames() to ApiCollection, added more method modifiers to signature parsing

Added getApiNames() to ApiCollection, added more method modifiers to signature parsing


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

Branch: refs/heads/master
Commit: 24e196bc6f3af120e4495ce8f3d2c7bee391bb6c
Parents: 3d46cbf
Author: Dhiraj Bokde <dh...@yahoo.com>
Authored: Fri May 30 11:14:46 2014 -0700
Committer: Dhiraj Bokde <dh...@yahoo.com>
Committed: Tue Jun 10 12:48:32 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/camel/util/component/ApiCollection.java     | 5 +++++
 .../java/org/apache/camel/util/component/ApiMethodParser.java   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/24e196bc/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index 585fbb2..6520d1c 100644
--- a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -16,8 +16,10 @@
  */
 package org.apache.camel.util.component;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * Base class for a collection of ApiMethods. Meant to be extended by Components to create the api name map.
@@ -30,4 +32,7 @@ public abstract class ApiCollection {
         return apis.get(apiName);
     }
 
+    public final Set<String> getApiNames() {
+        return Collections.unmodifiableSet(apis.keySet());
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/24e196bc/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index 933a0b9..b7e6ef7 100644
--- a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -93,7 +93,7 @@ public abstract class ApiMethodParser<T> {
         List<ApiMethodModel> result = new ArrayList<ApiMethodModel>();
         for (String signature: signatures) {
             // remove all type parameters and modifiers
-            signature = signature.replaceAll("<[^>]*>|public|final", "");
+            signature = signature.replaceAll("<[^>]*>|\\s*(public|final|synchronized|native)\\s*", "");
             log.debug("Processing " + signature);
 
             final Matcher methodMatcher = METHOD_PATTERN.matcher(signature);