Skip to content

Commit

Permalink
Fix #3: @param is now Quarkified!
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 17, 2024
1 parent 0e97370 commit 7eaf410
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveCla
// All utilities
classNames.addAll(collectClassesInPackage(combinedIndex, "org.omnifaces.util"));

classNames.addAll(collectSubclasses(combinedIndex, java.lang.Number.class.getName()));
classNames.add(java.lang.Integer.class.getName());
classNames.add(java.lang.String.class.getName());

reflectiveClass.produce(
ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).build());
ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).serialization(true).build());
}

@Record(ExecutionTime.STATIC_INIT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Date;
import java.util.List;

import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.RequestScoped;
import jakarta.faces.FacesException;
import jakarta.faces.convert.DateTimeConverter;
import jakarta.faces.validator.LengthValidator;
import jakarta.inject.Inject;
import jakarta.inject.Named;
Expand Down Expand Up @@ -47,12 +45,6 @@ public class CdiParamBean {
@Param
Integer number;

// Like <f:viewParam name="date" value="#{bean.date}" converterMessage="..."><f:convertDateTime pattern="yyyyMMdd">
@Inject
@Param(converterClass = DateTimeConverter.class, converterAttributes = {
@Attribute(name = "pattern", value = "yyyyMMdd") }, converterMessage = "{1}: \"{0}\" is not the date format we had in mind! Please use the format yyyyMMdd.")
Date date;

private String result;

@PostConstruct
Expand All @@ -62,8 +54,8 @@ public void init() {
return;
}

result = String.format("You entered text1 '%s', text2 '%s', text3 '%s', number '%d', date '%5$tY%5$tm%5$td'", text1,
text2, text3, number, date);
result = String.format("You entered text1 '%s', text2 '%s', text3 '%s', number '%d'", text1,
text2, text3, number);

Messages.addGlobalInfo("Yes, no validation errors!");
}
Expand Down Expand Up @@ -92,4 +84,4 @@ public static <T> T copy(T source) {
return copy;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,12 @@
<f:param name="text3" value="baz1" />
<f:param name="text3" value="baz2" />
<f:param name="number" value="42" />
<f:param name="date" value="19780326" />
</h:link>
</li>
<li>
<h:link value="Omit required param and set wrong values on others">
<f:param name="text2" value="x" />
<f:param name="number" value="NaN" />
<f:param name="date" value="26 Mar 1978" />
</h:link>
</li>
</ul>
Expand Down

0 comments on commit 7eaf410

Please sign in to comment.