mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
#21 Umsetzung der API Rückgabe, erste version
This commit is contained in:
parent
a424fbbcfe
commit
ab31ed71b1
21 changed files with 532 additions and 147 deletions
44
src/main/java/de/kosit/validationtool/api/Result.java
Normal file
44
src/main/java/de/kosit/validationtool/api/Result.java
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package de.kosit.validationtool.api;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import net.sf.saxon.dom.NodeOverNodeInfo;
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
* API Rückgabe Objekt des Ergebnisses des Validierungsprozesses.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class Result {
|
||||
|
||||
/** Der generierte Report. */
|
||||
private final XdmNode report;
|
||||
|
||||
/** Das evaluierte Ergebnis. */
|
||||
private final AcceptRecommendation acceptRecommendation;
|
||||
|
||||
/**
|
||||
* Gibt den Report als W3C-{@link Document} zurück.
|
||||
*
|
||||
* @return der Report
|
||||
*/
|
||||
public Document getReportDocument() {
|
||||
return (Document) NodeOverNodeInfo.wrap(getReport().getUnderlyingNode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
|
||||
*
|
||||
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
|
||||
*/
|
||||
public boolean isAcceptable() {
|
||||
return AcceptRecommendation.ACCEPTABLE.equals(acceptRecommendation);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue