diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-02 15:37:05 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-02 15:37:05 +0000 |
commit | c30d85f5d1d1ead6e9ad703f87392992e38150ac (patch) | |
tree | 71322bd610db5f5dac2b5399c3ef1325cca5d7f5 /branches/sca-java-1.3/modules/interface-java-jaxws | |
parent | 4c7b2e5c0549718ed1814edbb1adb8166efe4fca (diff) |
Fix for TUSCANY-2444, merged from trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673421 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.3/modules/interface-java-jaxws')
4 files changed, 20 insertions, 5 deletions
diff --git a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java index a23036db7c..b05715b54e 100644 --- a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java +++ b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java @@ -261,5 +261,20 @@ public class CodeGenerationHelper { return Opcodes.ARETURN; } + + /** + * Get the package prefix for generated JAXWS artifacts + * @param cls + * @return + */ + public static String getPackagePrefix(Class<?> cls) { + String name = cls.getName(); + int index = name.lastIndexOf('.'); + if (index == -1) { + return "jaxws."; + } else { + return name.substring(0, index) + ".jaxws."; + } + } } diff --git a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java index fa32060447..a4f2facb4b 100644 --- a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java +++ b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java @@ -293,7 +293,7 @@ public class JAXWSFaultExceptionMapper implements FaultExceptionMapper { } if (faultBean == null) { - final String faultBeanClassName = cls.getPackage().getName() + ".jaxws." + cls.getSimpleName() + "Bean"; + final String faultBeanClassName = CodeGenerationHelper.getPackagePrefix(cls) + cls.getSimpleName() + "Bean"; final QName qname = faultName; faultType = AccessController.doPrivileged(new PrivilegedAction<DataType<XMLType>>() { public DataType<XMLType> run() { diff --git a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java index 758dcb5dd7..1e1a0c4e94 100644 --- a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java +++ b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java @@ -188,7 +188,7 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { requestWrapper == null ? operationName : getValue(requestWrapper.localName(), operationName); String wrapperBeanName = requestWrapper == null ? "" : requestWrapper.className(); if ("".equals(wrapperBeanName)) { - wrapperBeanName = clazz.getPackage().getName() + ".jaxws." + capitalize(method.getName()); + wrapperBeanName = CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName()); } DataType<XMLType> inputWrapperDT = null; @@ -222,7 +222,7 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { wrapperBeanName = responseWrapper == null ? "" : responseWrapper.className(); if ("".equals(wrapperBeanName)) { wrapperBeanName = - clazz.getPackage().getName() + ".jaxws." + capitalize(method.getName()) + "Response"; + CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName()) + "Response"; } DataType<XMLType> outputWrapperDT = null; diff --git a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java index d4b1d93ba3..412e6e14a6 100644 --- a/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java +++ b/branches/sca-java-1.3/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java @@ -46,7 +46,7 @@ public class WrapperBeanGenerator extends BaseBeanGenerator { String wrapperNamespace = JavaInterfaceUtil.getNamespace(sei); String wrapperName = m.getName(); String wrapperBeanName = capitalize(wrapperName); - String wrapperClassName = sei.getPackage().getName() + ".jaxws." + wrapperBeanName; + String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName; return generateRequestWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl); } @@ -90,7 +90,7 @@ public class WrapperBeanGenerator extends BaseBeanGenerator { String wrapperName = m.getName() + "Response"; String wrapperBeanName = capitalize(wrapperName); - String wrapperClassName = sei.getPackage().getName() + ".jaxws." + wrapperBeanName; + String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName; return generateResponseWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl); } |