From 7caa627c934eda91760cd7498de45e333e6941b9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 22 Sep 2022 13:12:51 +0200 Subject: [PATCH] Update LinkageProcessor --- src/de/steamwar/linkage/LinkageProcessor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/de/steamwar/linkage/LinkageProcessor.java b/src/de/steamwar/linkage/LinkageProcessor.java index 07a4ed0..7f43a0b 100644 --- a/src/de/steamwar/linkage/LinkageProcessor.java +++ b/src/de/steamwar/linkage/LinkageProcessor.java @@ -98,7 +98,14 @@ public class LinkageProcessor extends AbstractProcessor { buildPlan.addImport("java.util.HashSet"); buildPlan.addField(new FieldBuilder("Set>", "enabled", "new HashSet<>()")); + MethodBuilder runsMethod = new MethodBuilder("run", "void"); + runsMethod.addParameter(new ParameterBuilder("Class...", "types")); + runsMethod.addLine("for (Class type : types) run(type);"); + buildPlan.addMethod(runsMethod); + + MethodBuilder runMethod = new MethodBuilder("run", "void"); + runMethod.setPrivate(true); buildPlan.addMethod(runMethod); runMethod.addParameter(new ParameterBuilder("Class", "type")); runMethod.addLine("if (!enabled.add(type)) return;");