Class Generator
java.lang.Object
ch.colabproject.colab.generator.plugin.Generator
- Author:
- maxence
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateJavaClient(String targetDir, boolean dryRun) One all classes have been processed withprocessPackages(), this method will create subdirectories that match thepackageName.Then the client will be generated in theclientName.java file.voidgenerateTypescriptClient(String targetDir, boolean dryRun) Generate typescript client in targetDirjakarta.json.bind.Jsonbget JSON-B to use.Get rest service descriptionvoidProcess all classes annotated withPath.
-
Constructor Details
-
Generator
Initialize the client generator.- Parameters:
restPackages- packages to analyzepackageName- package in which generate the clientclientName- client class name
-
Generator
Initialize the client generator.- Parameters:
pkgs- packages to analyze
-
-
Method Details
-
getJsonBMapper
public jakarta.json.bind.Jsonb getJsonBMapper()get JSON-B to use.- Returns:
- jsbonb mapper
-
processPackages
public void processPackages()Process all classes annotated withPath. Generate aRestEndpointinstance for each class and store them inrestEndpoints -
generateJavaClient
public void generateJavaClient(String targetDir, boolean dryRun) throws org.apache.maven.plugin.MojoFailureException One all classes have been processed withprocessPackages(), this method will create subdirectories that match thepackageName.Then the client will be generated in theclientName.java file.- Parameters:
targetDir- target directorydryRun- if true, do not generate files but print output to console- Throws:
org.apache.maven.plugin.MojoFailureException- if generation fails
-
getRestEndpoints
Get rest service description- Returns:
- all rest resource
-
generateTypescriptClient
public void generateTypescriptClient(String targetDir, boolean dryRun) throws org.apache.maven.plugin.MojoFailureException Generate typescript client in targetDir- Parameters:
targetDir- generate TS module in this directorydryRun- if true, do not generate any file but print output to console- Throws:
org.apache.maven.plugin.MojoFailureException- if generation fails
-