Skip to content

Commit

Permalink
Validierung optimiert
Browse files Browse the repository at this point in the history
  • Loading branch information
Oli B committed Jan 2, 2024
1 parent cfa3586 commit c182681
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/src/main/java/gdv/xport/feld/Feld.java
Original file line number Diff line number Diff line change
Expand Up @@ -737,18 +737,12 @@ public String validate(String value, Config validationConfig) {
*/
protected String validateLax(String value) {
LOG.debug("Inhalt von '{}' wird validiert.", value);
for (char c : value.toCharArray()) {
validateChar(value, c);
if (!Text.of(value).isPrintable()) {
throw new ValidationException(String.format("Text '%s' enthaelt ungueltige Zeichen", value));
}
return value;
}

private void validateChar(String value, char c) {
if (!Text.of(Character.toString(c)).isPrintable()) {
throw new ValidationException(String.format("Text '%s' enthaelt ungueltige Zeichen '%c'", value, c));
}
}

/**
* Dieser validate-Methode validiert strenger und kann von Unterklassen
* ueberschrieben werden.
Expand Down

0 comments on commit c182681

Please sign in to comment.