camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject [03/21] git commit: some more fixes for using inner classes
Date Mon, 08 Sep 2014 13:57:40 GMT
some more fixes for using inner classes


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

Branch: refs/heads/master
Commit: 97aa19bab6cbea641c05ec20ef052a9df8a6ff0a
Parents: a4b235c
Author: Jonathan Anstey <janstey@gmail.com>
Authored: Thu Jul 3 16:08:46 2014 -0230
Committer: Jonathan Anstey <janstey@gmail.com>
Committed: Mon Sep 8 09:06:08 2014 -0230

----------------------------------------------------------------------
 .../camel/maven/AbstractApiMethodGeneratorMojo.java    | 13 ++++++++++---
 .../src/main/resources/api-method-enum.vm              |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/97aa19ba/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
index 387fc7c..d11d894 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
@@ -117,7 +117,8 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa
     }
 
     private String getEnumName() throws MojoExecutionException {
-        return getProxyType().getSimpleName() + "ApiMethod";
+        String proxyClassWithCanonicalName = getProxyClassWithCanonicalName(proxyClass);
+        return proxyClassWithCanonicalName.substring(proxyClassWithCanonicalName.lastIndexOf('.')
+ 1) + "ApiMethod";
     }
 
     private VelocityContext getApiTestContext(List<ApiMethodParser.ApiMethodModel>
models) throws MojoExecutionException {
@@ -138,7 +139,8 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa
     }
 
     private String getUnitTestName() throws MojoExecutionException {
-        return getProxyType().getSimpleName() + "IntegrationTest";
+        String proxyClassWithCanonicalName = getProxyClassWithCanonicalName(proxyClass);
+        return proxyClassWithCanonicalName.substring(proxyClassWithCanonicalName.lastIndexOf('.')
+ 1) + "IntegrationTest";
     }
 
     private VelocityContext getEndpointContext(List<ApiMethodParser.ApiMethodModel>
models) throws MojoExecutionException {
@@ -199,9 +201,14 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa
     }
 
     private String getConfigName() throws MojoExecutionException {
-        return getProxyType().getSimpleName() + "EndpointConfiguration";
+        String proxyClassWithCanonicalName = getProxyClassWithCanonicalName(proxyClass);
+        return proxyClassWithCanonicalName.substring(proxyClassWithCanonicalName.lastIndexOf('.')
+ 1) + "EndpointConfiguration";
     }
 
+    private String getProxyClassWithCanonicalName(String proxyClass) {
+        return proxyClass.replace("$", "");
+    }
+    
     private VelocityContext getCommonContext(List<ApiMethodParser.ApiMethodModel> models)
throws MojoExecutionException {
         VelocityContext context = new VelocityContext();
         context.put("models", models);

http://git-wip-us.apache.org/repos/asf/camel/blob/97aa19ba/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
index 9dab27c..9827d1e 100644
--- a/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
+++ b/tooling/maven/camel-api-component-maven-plugin/src/main/resources/api-method-enum.vm
@@ -24,7 +24,7 @@ package $packageName;
 import java.lang.reflect.Method;
 import java.util.List;
 
-import $proxyType.Name;
+import $proxyType.CanonicalName;
 
 import org.apache.camel.util.component.ApiMethod;
 import org.apache.camel.util.component.ApiMethodImpl;


Mime
View raw message