mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
24-FixGrammar
This commit is contained in:
parent
65184aeb81
commit
7d99b83e07
21 changed files with 32 additions and 32 deletions
|
|
@ -29,8 +29,8 @@ import java.util.stream.Collectors;
|
||||||
public interface Check {
|
public interface Check {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document
|
* Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change this document you
|
||||||
* you need to copy the nodes into an new {@link Document}.
|
* need to copy the nodes into a new {@link Document}.
|
||||||
*
|
*
|
||||||
* @param input the resource / xml file to validate.
|
* @param input the resource / xml file to validate.
|
||||||
* @return a result-{@link Document} (readonly)
|
* @return a result-{@link Document} (readonly)
|
||||||
|
|
@ -51,7 +51,7 @@ public interface Check {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks an incoming xml files in batch mode. Processing is sequential. The result-{@link Document Documents} are
|
* Checks an incoming xml files in batch mode. Processing is sequential. The result-{@link Document Documents} are
|
||||||
* readonly. To change the this document you need to copy them into new {@link Document Documents}.
|
* readonly. To change this document you need to copy them into new {@link Document Documents}.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param input list of xml {@link Input Inputs}
|
* @param input list of xml {@link Input Inputs}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public interface Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads an XML based scenario definition from the file with an specific repository / source location specified via
|
* Loads an XML based scenario definition from the file with a specific repository / source location specified via
|
||||||
* URIs.
|
* URIs.
|
||||||
*
|
*
|
||||||
* @param scenarioDefinition the XML file with scenario definition
|
* @param scenarioDefinition the XML file with scenario definition
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||||
* Commandline interface of the validator. It parses the commandline args and hands over actual execution to
|
* Commandline interface of the validator. It parses the commandline args and hands over actual execution to
|
||||||
* {@link Validator}.
|
* {@link Validator}.
|
||||||
* <p>
|
* <p>
|
||||||
* This separated from {@link Validator} to configure the slf4j simple logging.
|
* This separated from {@link Validator} to configure the SLF4J simple logging.
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ class InternalCheck extends DefaultCheck {
|
||||||
* Prüft die Prüflinge und gibt Informationen über etwaige Assertions aus.
|
* Prüft die Prüflinge und gibt Informationen über etwaige Assertions aus.
|
||||||
*
|
*
|
||||||
* @param input die Prüflinge
|
* @param input die Prüflinge
|
||||||
* @return false wenn es Assertion-Fehler gibt, sonst true
|
* @return false, wenn es Assertion-Fehler gibt, sonst true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result checkInput(final Input input) {
|
public Result checkInput(final Input input) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An text based grid for cli based programs.
|
* A text based grid for cli based programs.
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ public class ConfigurationBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a {@link Scenario} to this list of know scenarios. Note: order of calling this methods defines order of
|
* Adds a {@link Scenario} to this list of know scenarios. Note: order of calling these methods defines order of
|
||||||
* scenarios when determining the target scenario for a given xml file.
|
* scenarios when determining the target scenario for a given xml file.
|
||||||
*
|
*
|
||||||
* @param scenarioBuilder the {@link ScenarioBuilder} building the {@link Scenario}
|
* @param scenarioBuilder the {@link ScenarioBuilder} building the {@link Scenario}
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public class ScenarioBuilder implements Builder<Scenario> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an xpath expression to match the scenario. You can leverage declared namespaces.
|
* Add a xpath expression to match the scenario. You can leverage declared namespaces.
|
||||||
*
|
*
|
||||||
* @param xpath the expression
|
* @param xpath the expression
|
||||||
* @return this
|
* @return this
|
||||||
|
|
@ -136,7 +136,7 @@ public class ScenarioBuilder implements Builder<Scenario> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an xpath expression to compute acceptance for the scenario. You can leverage declared namespaces.
|
* Add a xpath expression to compute acceptance for the scenario. You can leverage declared namespaces.
|
||||||
*
|
*
|
||||||
* @param acceptXpath the xpath expresison
|
* @param acceptXpath the xpath expresison
|
||||||
* @return this
|
* @return this
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple base implemenation for http handlers. Doing I/O stuff.
|
* Simple base implementation for http handlers (doing I/O stuff).
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ import java.net.URI;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird um hier die Verarbeitung des
|
* Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird, um hier die Verarbeitung
|
||||||
* POST Request zu realisieren.
|
* des POST Request zu realisieren.
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -52,8 +52,7 @@ class CheckHandler extends BaseHandler {
|
||||||
/**
|
/**
|
||||||
* Methode, die eine gegebene Anforderung verarbeitet und eine entsprechende Antwort generiert
|
* Methode, die eine gegebene Anforderung verarbeitet und eine entsprechende Antwort generiert
|
||||||
*
|
*
|
||||||
* @param httpExchange kapselt eine empfangene HTTP-Anforderung und eine Antwort, die in einem Exchange generiert
|
* @param httpExchange kapselt eine empfangene HTTP-Anforderung und eine Antwort.
|
||||||
* werden soll.
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void handle(final HttpExchange httpExchange) throws IOException {
|
public void handle(final HttpExchange httpExchange) throws IOException {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
/**
|
/**
|
||||||
* Zeigt an, ob Validierungsfehler vorhanden sind.
|
* Zeigt an, ob Validierungsfehler vorhanden sind.
|
||||||
*
|
*
|
||||||
* @return true wenn mindestens ein Fehler vorhanden ist.
|
* @return true, wenn mindestens ein Fehler vorhanden ist.
|
||||||
*/
|
*/
|
||||||
public boolean hasErrors() {
|
public boolean hasErrors() {
|
||||||
return hasEvents() && this.errors.stream().anyMatch(e -> e.getSeverityCode() != XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
return hasEvents() && this.errors.stream().anyMatch(e -> e.getSeverityCode() != XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
||||||
|
|
@ -104,7 +104,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
/**
|
/**
|
||||||
* Zeigt an, ob es Validierungs-Ereignisse gab.
|
* Zeigt an, ob es Validierungs-Ereignisse gab.
|
||||||
*
|
*
|
||||||
* @return true wenn mindestens ein Validierungsereignis aufgetreten ist
|
* @return true, wenn mindestens ein Validierungsereignis aufgetreten ist
|
||||||
*/
|
*/
|
||||||
public boolean hasEvents() {
|
public boolean hasEvents() {
|
||||||
return !this.errors.isEmpty();
|
return !this.errors.isEmpty();
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ public class ContentRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erzeugt einen [@link XPathExecutable} auf Basis der angegebenen Informationen.
|
* Erzeugt einen {@link XPathExecutable} auf Basis der angegebenen Informationen.
|
||||||
*
|
*
|
||||||
* @param expression der XPATH-Ausdruck
|
* @param expression der XPATH-Ausdruck
|
||||||
* @param namespaces optionale Namespace-Mappings
|
* @param namespaces optionale Namespace-Mappings
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The reference implementation for the validation process. After initialisation, instances are threadsafe and should be
|
* The reference implementation for the validation process. After initialisation, instances are threadsafe and should be
|
||||||
* reused since initializing saxon runtime objects is an rather heavyweight process.
|
* reused since initializing saxon runtime objects is a rather heavyweight process.
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ public class SchemaProvider {
|
||||||
private static Schema reportInputSchema;
|
private static Schema reportInputSchema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefert das definierte Schema für die Validierung des [@link CreateReportInput}
|
* Liefert das definierte Schema für die Validierung des
|
||||||
|
* {@link de.kosit.validationtool.model.reportInput.CreateReportInput}
|
||||||
*
|
*
|
||||||
* @return ReportInput-Schema
|
* @return ReportInput-Schema
|
||||||
*/
|
*/
|
||||||
|
|
@ -74,7 +75,7 @@ public class SchemaProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefert das definiert Schema für die Szenario-Konfiguration
|
* Liefert das definierte Schema für die Szenario-Konfiguration
|
||||||
*
|
*
|
||||||
* @return Scenario-Schema
|
* @return Scenario-Schema
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
|
||||||
/**
|
/**
|
||||||
* A validator {@link de.kosit.validationtool.api.Input} based on a {@link Source}.
|
* A validator {@link de.kosit.validationtool.api.Input} based on a {@link Source}.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: The various implementations of {@link Source} varies wether the can be read twice or no. This implementation
|
* Note: The various implementations of {@link Source} varies whether they can be read twice or not. This implementation
|
||||||
* tries to handle this with respect document identification (hashcode).
|
* tries to handle this with respect document identification (hashcode).
|
||||||
* <p>
|
* <p>
|
||||||
* This class is known to work with:
|
* This class is known to work with:
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public abstract class BaseOutput {
|
||||||
/**
|
/**
|
||||||
* Ermittelt, ob es bei der Validierung {@link FailedAssert}s gab.
|
* Ermittelt, ob es bei der Validierung {@link FailedAssert}s gab.
|
||||||
*
|
*
|
||||||
* @return true wenn mindestens ein {@link FailedAssert} vorhanden ist
|
* @return true, wenn mindestens ein {@link FailedAssert} vorhanden ist
|
||||||
*/
|
*/
|
||||||
public boolean hasFailedAsserts() {
|
public boolean hasFailedAsserts() {
|
||||||
return !getFailedAsserts().isEmpty();
|
return !getFailedAsserts().isEmpty();
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class Result<T, E> {
|
||||||
/**
|
/**
|
||||||
* Zeigt an, ob das Ergebnis valide, also ohne Fehler ist.
|
* Zeigt an, ob das Ergebnis valide, also ohne Fehler ist.
|
||||||
*
|
*
|
||||||
* @return true wenn erfolgreich
|
* @return true, wenn erfolgreich
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return object != null && errors.isEmpty();
|
return object != null && errors.isEmpty();
|
||||||
|
|
@ -69,7 +69,7 @@ public class Result<T, E> {
|
||||||
/**
|
/**
|
||||||
* Zeigt an, ob das Ergebnis nicht valide ist, als entsprechend Fehler gesammelt wurden.
|
* Zeigt an, ob das Ergebnis nicht valide ist, als entsprechend Fehler gesammelt wurden.
|
||||||
*
|
*
|
||||||
* @return true wenn erfolgreich wenn Fehler vorhanden sind.
|
* @return true, wenn erfolgreich, false, wenn Fehler vorhanden sind.
|
||||||
*/
|
*/
|
||||||
public boolean isInvalid() {
|
public boolean isInvalid() {
|
||||||
return !isValid();
|
return !isValid();
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erzeugt den Report auf Basis der gesammelten Informationen über den Prüfling. Sollte kein Szenario identifiziert
|
* Erzeugt den Report auf Basis der gesammelten Informationen über den Prüfling. Sollte kein Szenario identifiziert
|
||||||
* worden sein, so wird ein das Fallback-Szenario verwend und ein default report} erzeugt.
|
* worden sein, so wird ein das Fallback-Szenario verwendet und ein default report erzeugt.
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
|
|
@ -122,7 +122,7 @@ public class CreateReportAction implements CheckAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect
|
* Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect
|
||||||
* on {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops this
|
* on {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops these
|
||||||
* exceptions.
|
* exceptions.
|
||||||
*/
|
*/
|
||||||
private static class ReaderWrapper implements XMLReader {
|
private static class ReaderWrapper implements XMLReader {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class DocumentParseAction implements CheckAction {
|
||||||
private final Processor processor;
|
private final Processor processor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parsed und überprüft ein übergebenes Dokument darauf ob es well-formed ist. Dies stellt den ersten
|
* Parsed und überprüft ein übergebenes Dokument darauf, ob es well-formed ist. Dies stellt den ersten
|
||||||
* Verarbeitungsschritt des Prüf-Tools dar. Diese Funktion verzichtet explizit auf die Validierung gegenüber einem
|
* Verarbeitungsschritt des Prüf-Tools dar. Diese Funktion verzichtet explizit auf die Validierung gegenüber einem
|
||||||
* Schema.
|
* Schema.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class SchemaValidationAction implements CheckAction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
// nothing do do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ public class ClassPathResourceResolver implements LSResourceResolver {
|
||||||
private String stringData;
|
private String stringData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiierung einer neue Instanz.
|
* Instantiierung einer neuen Instanz.
|
||||||
*
|
*
|
||||||
* @param publicId die publicId
|
* @param publicId die publicId
|
||||||
* @param systemId die systemId
|
* @param systemId die systemId
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ import javax.xml.validation.Validator;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a slightly more open implementation that allows resolving artifacts from local filesystems. Your are not
|
* This is a slightly more open implementation that allows resolving artifacts from local filesystems. You are not bound
|
||||||
* bound to a specific 'repository'. But your validation artifacts (schema, xsl, etc.) must be available locally. This
|
* to a specific 'repository'. But your validation artifacts (schema, xsl, etc.) must be available locally. This
|
||||||
* implementation does not allow loading from http sources
|
* implementation does not allow loading from http sources
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue