mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
(chore) Erweiterung des Interface um API-Kompatibilität sicherzustellen
This commit is contained in:
parent
77665936ed
commit
5614e99e00
4 changed files with 54 additions and 10 deletions
|
|
@ -24,6 +24,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import net.sf.saxon.dom.NodeOverNodeInfo;
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
|
|
@ -35,21 +36,46 @@ public interface Check {
|
|||
|
||||
/**
|
||||
* Führt die konfigurierte Prüfung für die übergebene Resource aus.
|
||||
*
|
||||
*
|
||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||
* @return ein Ergebnis-{@link Document}
|
||||
* @deprecated use {@link #checkInput(Input)}
|
||||
*/
|
||||
@Deprecated
|
||||
default Document check(Input input) {
|
||||
final XdmNode node = checkInput(input);
|
||||
// readonly view of the document!!!
|
||||
return (Document) NodeOverNodeInfo.wrap(node.getUnderlyingNode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Führt die konfigurierte Prüfung für die übergebene Resource aus.
|
||||
*
|
||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||
* @return ein Ergebnis-{@link Document}
|
||||
*/
|
||||
XdmNode check(Input input);
|
||||
|
||||
XdmNode checkInput(Input input);
|
||||
|
||||
/**
|
||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus.
|
||||
*
|
||||
* @param input die Eingabe
|
||||
* @return Liste mit Ergebnis-Dokumenten
|
||||
* @deprecated use {@link #checkInput(List)}
|
||||
*/
|
||||
default List<XdmNode> check(List<Input> input) {
|
||||
@Deprecated
|
||||
default List<Document> check(List<Input> input) {
|
||||
return input.stream().map(this::check).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus.
|
||||
*
|
||||
* @param input die Eingabe
|
||||
* @return Liste mit Ergebnis-Dokumenten
|
||||
*/
|
||||
default List<XdmNode> checkInput(List<Input> input) {
|
||||
return input.stream().map(this::checkInput).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue