String clsName = ""; if (rw == null) { clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()); } else { clsName = rw.className();
String clsName = ""; if (rw == null) { clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()) + "Response"; } else {
private String getSetterParamName(String fieldName) { return "new" + StringUtils.capitalize(fieldName); }
private String getSetterParamName(String fieldName) { return "new" + StringUtils.capitalize(fieldName); }
private void writeImplementsInterface(StringBuilder sb, String clsName, boolean interfaceIsGenerated) { if (generateInterfaces && !interfaceIsGenerated) { sb.append(" implements " + StringUtils.capitalize(clsName)); } }
+ StringUtils.capitalize(op.getName().getLocalPart()); if (!isRequest) { className = className + "Response";
private String firstCharToUpperCase(String name) { if (name.length() > 0 && Character.isLowerCase(name.charAt(0))) { return StringUtils.capitalize(name); } return name; }
String clsName = ""; if (rw == null) { clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()); } else { clsName = rw.className();
String clsName = ""; if (rw == null) { clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()) + "Response"; } else {
try { Method getter = requestBody.getClass(). getMethod("get" + StringUtils.capitalize(varName), new Class<?>[]{}); list.add(getter.invoke(requestBody, new Object[]{})); } catch (Exception ex) {
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String reqClassName = getClassName(); String reqNs = null; if (reqWrapper != null) { reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName; reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace() : null; } if (reqClassName == null) { reqClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName); } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(reqClassName); jClass.setNamespace(reqNs); return jClass; }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String reqClassName = getClassName(); String reqNs = null; if (reqWrapper != null) { reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName; reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace() : null; } if (reqClassName == null) { reqClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName); } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(reqClassName); jClass.setNamespace(reqNs); return jClass; }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String resClassName = getClassName(); String resNs = null; if (resWrapper != null) { resClassName = resWrapper.className().length() > 0 ? resWrapper.className() : resClassName; resNs = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : null; } if (resClassName == null) { resClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName) + "Response"; } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(resClassName); jClass.setNamespace(resNs); return jClass; } }
public void generateExecutionService(InputStream wsdlContent, InputStream businessModelAsXsd) { logger.debug(">> generateExecutionService(wsdlContent={}, businessModelAsXsd={}, basePackageName={})", wsdlContent, businessModelAsXsd, guvnorRepository.getPackageName()); try { //___ Create target project folder in maven style byte[] wsdlBytes =IOUtils.toByteArray(wsdlContent) ; MavenProject mavenProject = mavenProjectFactory.createNewWarMavenProject(new ByteArrayInputStream(wsdlBytes), businessModelAsXsd, guvnorRepository, mavenPath, baseGeneratedPath); //___ Generate all files based on maven-cxf-plugin mavenProject.generateSources(); //___ Create the Impl file according to the Port name from the wsdl File executionServiceClassFile = mavenProject.createSourceFile(guvnorRepository.getPackageName(), EXECUTION_SERVICE_CLASS_NAME); ClassSourceCodeInjector classSourceCodeInjector = new ClassSourceCodeInjector(executionServiceClassFile, new ByteArrayInputStream(wsdlBytes), guvnorRepository.getPackageName()); File classFile = mavenProject.getSourceFile(StringUtils.capitalize(classSourceCodeInjector.getKeywordValue(PORT_TYPE)).concat(".java")); List<ProcessStructure> processStructures = extractMethodStructures(classFile); classSourceCodeInjector.customize(processStructures, guvnorRepository.getPackageName()); File executionServiceInterfaceFile = mavenProject.createSourceFile(guvnorRepository.getPackageName(), EXECUTION_SERVICE_INTERFACE_NAME); InterfaceSourceCodeInjector interfaceSourceCodeInjector = new InterfaceSourceCodeInjector(executionServiceInterfaceFile, new ByteArrayInputStream(wsdlBytes), guvnorRepository.getPackageName()); File interfaceFile = mavenProject.getSourceFile(StringUtils.capitalize(interfaceSourceCodeInjector.getKeywordValue(InterfaceSourceCodeInjector.Keyword2.PORT_TYPE)).concat(".java")); List<ProcessStructure> processStructures2 = extractMethodStructures(interfaceFile); interfaceSourceCodeInjector.customize(processStructures2); //___ Package all these into a war file... InputStream warFileInputStream = mavenProject.buildUpPackage(); //___ Deploy it somehow, somewhere.... // TODO } catch (Exception e) { throw Throwables.propagate(e); } finally { logger.debug("<< generateExecutionService()"); } }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String resClassName = getClassName(); String resNs = null; if (resWrapper != null) { resClassName = resWrapper.className().length() > 0 ? resWrapper.className() : resClassName; resNs = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : null; } if (resClassName == null) { resClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName) + "Response"; } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(resClassName); jClass.setNamespace(resNs); return jClass; } }
private void constructOneItem(XmlSchemaComplexType type, final String elementPrefix, String typeObjectName, ItemInfo itemInfo) { String accessorSuffix = StringUtils.capitalize(itemInfo.getJavascriptName());
public JavaMethod appendGetter(JavaField field) { String getterName = "get" + StringUtils.capitalize(field.getName()); JavaMethod jMethod = new JavaMethod(this); jMethod.setName(getterName); jMethod.setReturn(new JavaReturn(field.getParaName(), field.getType(), field.getTargetNamespace())); JavaCodeBlock block = new JavaCodeBlock(); JavaExpression exp = new JavaExpression(); exp.setValue("return this." + field.getParaName()); block.getExpressions().add(exp); jMethod.setJavaCodeBlock(block); addMethod(jMethod); return jMethod; }
public JavaMethod appendGetter(JavaField field) { String getterName = "get" + StringUtils.capitalize(field.getName()); JavaMethod jMethod = new JavaMethod(this); jMethod.setName(getterName); jMethod.setReturn(new JavaReturn(field.getParaName(), field.getType(), field.getTargetNamespace())); JavaCodeBlock block = new JavaCodeBlock(); JavaExpression exp = new JavaExpression(); exp.setValue("return this." + field.getParaName()); block.getExpressions().add(exp); jMethod.setJavaCodeBlock(block); addMethod(jMethod); return jMethod; }
public JavaMethod appendSetter(JavaField field) { String setterName = "set" + StringUtils.capitalize(field.getName()); JavaMethod jMethod = new JavaMethod(this); jMethod.setReturn(new JavaReturn("return", "void", null)); String paramName = getSetterParamName(field.getParaName()); jMethod.addParameter(new JavaParameter(paramName, field.getType(), field.getTargetNamespace())); JavaCodeBlock block = new JavaCodeBlock(); JavaExpression exp = new JavaExpression(); exp.setValue("this." + field.getParaName() + " = " + paramName); block.getExpressions().add(exp); jMethod.setJavaCodeBlock(block); jMethod.setName(setterName); addMethod(jMethod); return jMethod; }
public JavaMethod appendSetter(JavaField field) { String setterName = "set" + StringUtils.capitalize(field.getName()); JavaMethod jMethod = new JavaMethod(this); jMethod.setReturn(new JavaReturn("return", "void", null)); String paramName = getSetterParamName(field.getParaName()); jMethod.addParameter(new JavaParameter(paramName, field.getType(), field.getTargetNamespace())); JavaCodeBlock block = new JavaCodeBlock(); JavaExpression exp = new JavaExpression(); exp.setValue("this." + field.getParaName() + " = " + paramName); block.getExpressions().add(exp); jMethod.setJavaCodeBlock(block); jMethod.setName(setterName); addMethod(jMethod); return jMethod; }