-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to use custom builder for RestMethodModel
Signed-off-by: Oleksandr Porunov <[email protected]>
- Loading branch information
Showing
9 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...enerator-core/src/main/java/cz/habarta/typescript/generator/DefaultRestMethodBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cz.habarta.typescript.generator; | ||
|
||
import cz.habarta.typescript.generator.parser.MethodParameterModel; | ||
import cz.habarta.typescript.generator.parser.RestMethodModel; | ||
import cz.habarta.typescript.generator.parser.RestQueryParam; | ||
import java.lang.reflect.Method; | ||
import java.lang.reflect.Type; | ||
import java.util.List; | ||
|
||
public class DefaultRestMethodBuilder implements RestMethodBuilder{ | ||
|
||
@Override | ||
public RestMethodModel build(Class<?> originClass, String name, Type returnType, Method originalMethod, | ||
Class<?> rootResource, String httpMethod, String path, | ||
List<MethodParameterModel> pathParams, List<RestQueryParam> queryParams, | ||
MethodParameterModel entityParam, List<String> comments) { | ||
|
||
return new RestMethodModel(originClass, name, returnType, originalMethod, rootResource, httpMethod, path, | ||
pathParams, queryParams, entityParam, comments); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...cript-generator-core/src/main/java/cz/habarta/typescript/generator/RestMethodBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cz.habarta.typescript.generator; | ||
|
||
import cz.habarta.typescript.generator.parser.MethodParameterModel; | ||
import cz.habarta.typescript.generator.parser.RestMethodModel; | ||
import cz.habarta.typescript.generator.parser.RestQueryParam; | ||
import java.lang.reflect.Method; | ||
import java.lang.reflect.Type; | ||
import java.util.List; | ||
|
||
public interface RestMethodBuilder { | ||
|
||
RestMethodModel build(Class<?> originClass, String name, Type returnType, Method originalMethod, | ||
Class<?> rootResource, String httpMethod, String path, List<MethodParameterModel> pathParams, List<RestQueryParam> queryParams, MethodParameterModel entityParam, | ||
List<String> comments); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters