[STYLE] error commit

This commit is contained in:
Edouard DUPIN 2024-06-01 13:08:15 +02:00
parent dc6eeac008
commit 9c9da21bdb

View File

@ -44,7 +44,7 @@ public class TsGenerateApi {
} }
// Generate index of model files // Generate index of model files
createModelIndex(pathPackage, tsGroup); createModelIndex(pathPackage, tsGroup);
for (final ApiGroupModel element : api.apiModels) { for (final ApiGroupModel element : api.apiModels) {
TsApiGeneration.generateApiFile(element, pathPackage, tsGroup); TsApiGeneration.generateApiFile(element, pathPackage, tsGroup);
} }
@ -53,7 +53,7 @@ public class TsGenerateApi {
createIndex(pathPackage); createIndex(pathPackage);
copyResourceFile("rest-tools.ts", pathPackage + File.separator + "rest-tools.ts"); copyResourceFile("rest-tools.ts", pathPackage + File.separator + "rest-tools.ts");
} }
private static void createIndex(final String pathPackage) throws IOException { private static void createIndex(final String pathPackage) throws IOException {
final String out = """ final String out = """
/** /**
@ -62,13 +62,13 @@ public class TsGenerateApi {
export * from \"./model\"; export * from \"./model\";
export * from \"./api\"; export * from \"./api\";
export * from \"./rest-tools\"; export * from \"./rest-tools\";
"""; """;
final FileWriter myWriter = new FileWriter(pathPackage + File.separator + "index.ts"); final FileWriter myWriter = new FileWriter(pathPackage + File.separator + "index.ts");
myWriter.write(out); myWriter.write(out);
myWriter.close(); myWriter.close();
} }
private static void createResourceIndex(final String pathPackage, final List<ApiGroupModel> apiModels) private static void createResourceIndex(final String pathPackage, final List<ApiGroupModel> apiModels)
throws IOException { throws IOException {
final StringBuilder out = new StringBuilder(""" final StringBuilder out = new StringBuilder("""
@ -90,7 +90,7 @@ public class TsGenerateApi {
myWriter.write(out.toString()); myWriter.write(out.toString());
myWriter.close(); myWriter.close();
} }
private static void createModelIndex(final String pathPackage, final TsClassElementGroup tsGroup) private static void createModelIndex(final String pathPackage, final TsClassElementGroup tsGroup)
throws IOException { throws IOException {
final StringBuilder out = new StringBuilder(""" final StringBuilder out = new StringBuilder("""
@ -116,7 +116,7 @@ public class TsGenerateApi {
myWriter.write(out.toString()); myWriter.write(out.toString());
myWriter.close(); myWriter.close();
} }
private static List<TsClassElement> generateApiModel(final AnalyzeApi api) throws Exception { private static List<TsClassElement> generateApiModel(final AnalyzeApi api) throws Exception {
// First step is to add all specific basic elements the wrap correctly the model // First step is to add all specific basic elements the wrap correctly the model
final List<TsClassElement> tsModels = new ArrayList<>(); final List<TsClassElement> tsModels = new ArrayList<>();
@ -221,9 +221,9 @@ public class TsGenerateApi {
tsModels.add(new TsClassElement(model)); tsModels.add(new TsClassElement(model));
} }
return tsModels; return tsModels;
} }
public static void copyResourceFile(final String name, final String destinationPath) throws IOException { public static void copyResourceFile(final String name, final String destinationPath) throws IOException {
final InputStream ioStream = TsGenerateApi.class.getClassLoader().getResourceAsStream(name); final InputStream ioStream = TsGenerateApi.class.getClassLoader().getResourceAsStream(name);
if (ioStream == null) { if (ioStream == null) {