11/*
22 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
3- * Copyright 2018 SmartBear Software
43 *
54 * Licensed under the Apache License, Version 2.0 (the "License");
65 * you may not use this file except in compliance with the License.
1716
1817package org .openapitools .codegen .languages ;
1918
20- import com .samskivert .mustache .Mustache ;
21- import io .swagger .v3 .oas .models .OpenAPI ;
2219import io .swagger .v3 .oas .models .Operation ;
2320import io .swagger .v3 .oas .models .media .Schema ;
2421import lombok .Getter ;
2522import lombok .Setter ;
26- import org .apache .commons .lang3 .StringUtils ;
2723import org .openapitools .codegen .*;
2824
2925import org .openapitools .codegen .meta .features .*;
3329import org .openapitools .codegen .model .OperationsMap ;
3430import org .openapitools .codegen .templating .mustache .TrimWhitespaceLambda ;
3531import org .openapitools .codegen .utils .ModelUtils ;
36- import org .openapitools .codegen .utils .ProcessUtils ;
3732import org .slf4j .Logger ;
3833import org .slf4j .LoggerFactory ;
3934
4035import java .io .File ;
4136import java .util .*;
4237import java .util .stream .Collectors ;
43- import java .util .Objects ;
4438
45- import static org .apache .commons .lang3 .StringUtils .isNotEmpty ;
4639import static org .openapitools .codegen .utils .CamelizeOption .LOWERCASE_FIRST_LETTER ;
4740import org .openapitools .codegen .utils .CamelizeOption ;
4841import static org .openapitools .codegen .utils .StringUtils .camelize ;
49- import org .openapitools .codegen .model .OperationsMap ;
50- import org .openapitools .codegen .model .OperationMap ;
51- import org .openapitools .codegen .model .ModelMap ;
5242
5343
54- public class DubboCodegen extends AbstractJavaCodegen {
55- private final Logger LOGGER = LoggerFactory .getLogger (DubboCodegen .class );
56-
44+ public class JavaDubboServerCodegen extends AbstractJavaCodegen {
45+ private final Logger LOGGER = LoggerFactory .getLogger (JavaDubboServerCodegen .class );
5746
5847 public static final String TITLE = "title" ;
5948 public static final String CONFIG_PACKAGE = "configPackage" ;
@@ -80,7 +69,7 @@ public class DubboCodegen extends AbstractJavaCodegen {
8069 @ Setter protected boolean useGenericResponse = false ;
8170 @ Setter protected String registryAddress = "zookeeper://127.0.0.1:2181" ;
8271
83- public DubboCodegen () {
72+ public JavaDubboServerCodegen () {
8473 super ();
8574
8675 modifyFeatureSet (features -> features
@@ -215,15 +204,6 @@ public DubboCodegen() {
215204 cliOptions .add (CliOption .newBoolean (USE_GENERIC_RESPONSE , "Use generic response wrapper" , useGenericResponse ));
216205 cliOptions .add (new CliOption (REGISTRY_ADDRESS , "Registry address (e.g., zookeeper://127.0.0.1:2181 or nacos://127.0.0.1:8848)" )
217206 .defaultValue (registryAddress ));
218-
219- supportedLibraries .put (DEFAULT_LIBRARY , "Default Dubbo library" );
220- setLibrary (DEFAULT_LIBRARY );
221-
222- CliOption libraryOption = new CliOption (CodegenConstants .LIBRARY , "library template (sub-template) to use" );
223- libraryOption .setEnum (supportedLibraries );
224- libraryOption .setDefault (DEFAULT_LIBRARY );
225- cliOptions .add (libraryOption );
226- setLibrary (DEFAULT_LIBRARY );
227207 }
228208
229209 @ Override
@@ -233,7 +213,7 @@ public CodegenType getTag() {
233213
234214 @ Override
235215 public String getName () {
236- return "dubbo" ;
216+ return "java- dubbo" ;
237217 }
238218
239219 @ Override
@@ -400,7 +380,7 @@ public void processOpts() {
400380
401381 if (isUserTitle ) {
402382 String titleName = (String ) additionalProperties .get (TITLE );
403- mainClassName = camelize (titleName .trim (), CamelizeOption .UPPERCASE_FIRST_CHAR ) + "Application" ;
383+ mainClassName = ( camelize (titleName .trim (), CamelizeOption .UPPERCASE_FIRST_CHAR ) + "Application" ). replaceAll ( " \\ s+" , "" ); ;
404384 } else {
405385 mainClassName = "OpenApiGeneratorApplication" ;
406386 }
0 commit comments