
com.sun.tools.xjc.addon.krasa.validations.SystemOutValidationsLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of krasa-jaxb-tools Show documentation
Show all versions of krasa-jaxb-tools Show documentation
JAXB plugin to generate Bean Validation Annotations 2.0 (JSR-380) from XSDs
The newest version!
package com.sun.tools.xjc.addon.krasa.validations;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
* @author Francesco Illuminati
*/
class SystemOutValidationsLogger implements ValidationsLogger {
private final String className;
private final String propertyName;
public SystemOutValidationsLogger(String className, String propertyName) {
this.className = className;
this.propertyName = propertyName;
}
@Override
public void addAnnotation(String annotationName, Map parameterMap) {
String params = "";
if (!parameterMap.isEmpty()) {
params = parameterMap.entrySet().stream()
.map(e -> e.getKey() + "=" + e.getValue())
.collect(Collectors.joining(", "));
if (!params.isEmpty()) {
params = "(" + params + ")";
}
}
log("adding @" + annotationName + params + " to " + className + "." + propertyName);
}
private static void log(String message) {
System.out.println(PREFIX + message);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy