in log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java [215:249]
private static List<Property> getProperties(Class<?> intrface) {
List<Property> props = classMap.get(intrface);
if (props != null) {
return props;
}
props = new ArrayList<>();
Method[] methods = intrface.getMethods();
boolean isCompletionStatus = false;
for (Method method : methods) {
if (method.getName().startsWith("set") && !method.getName().equals("setAuditExceptionHandler")) {
if (method.getName().equals("setCompletionStatus")) {
isCompletionStatus = true;
}
String name = NamingUtils.lowerFirst(NamingUtils.getMethodShortName(method.getName()));
Annotation[] annotations = method.getDeclaredAnnotations();
List<Constraint> constraints = new ArrayList<>();
boolean isRequired = false;
for (Annotation annotation : annotations) {
if (annotation instanceof Constraint) {
constraints.add((Constraint) annotation);
}
if (annotation instanceof Required) {
isRequired = true;
}
}
props.add(new Property(name, isRequired, constraints));
}
}
if (!isCompletionStatus) {
props.add(new Property("completionStatus", false, new ArrayList<>()));
}
classMap.putIfAbsent(intrface, props);
return classMap.get(intrface);
}