Skip to content

Commit

Permalink
Native support for ChartJS, IteratorStatus, and Exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 18, 2024
1 parent 1d2bf35 commit a8d99c8
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void indexTransitiveDependencies(BuildProducer<IndexDependencyBuildItem> index)
index.produce(new IndexDependencyBuildItem("io.nayuki", "qrcodegen"));
index.produce(new IndexDependencyBuildItem("org.primefaces.extensions", "barcode4j-light"));
index.produce(new IndexDependencyBuildItem("org.overviewproject", "mime-types"));
index.produce(new IndexDependencyBuildItem("software.xdev", "chartjs-java-model"));
}

@BuildStep
Expand Down Expand Up @@ -106,6 +107,7 @@ void registerForReflection(PrimeFacesRecorder recorder, BuildProducer<Reflective
CombinedIndexBuildItem combinedIndex) {
// All utilities
final List<String> classNames = new ArrayList<>(List.of(
org.primefaces.component.api.IterationStatus.class.getName(),
org.primefaces.expression.SearchExpressionUtils.class.getName(),
org.primefaces.clientwindow.PrimeClientWindowUtils.class.getName(),
org.primefaces.renderkit.RendererUtils.class.getName(),
Expand Down Expand Up @@ -147,11 +149,24 @@ void registerForReflection(PrimeFacesRecorder recorder, BuildProducer<Reflective
classNames.add("javax.imageio.ImageIO");
classNames.add(org.krysalis.barcode4j.output.bitmap.ImageIOBitmapEncoder.class.getName());

// Chart XDev models
classNames.addAll(collectClassesInPackage(combinedIndex, "software.xdev.chartjs.model"));

// method reflection
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true)
.fields(true).build());

// constructor reflection

// Exporters
classNames.clear();
classNames.addAll(collectImplementors(combinedIndex, org.primefaces.component.export.Exporter.class.getName()));
classNames.addAll(collectImplementors(combinedIndex, org.primefaces.component.export.ExporterOptions.class.getName()));
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).constructors(true).methods(false)
.fields(false).build());

// neither
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(org.primefaces.config.PrimeEnvironment.class.getName()).build());
Expand Down

0 comments on commit a8d99c8

Please sign in to comment.