mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
Merge remote-tracking branch 'origin/release/1.5.x' into release/1.6.x
This commit is contained in:
commit
4e0a1e1fc5
38 changed files with 635 additions and 670 deletions
|
|
@ -38,7 +38,11 @@ public class Printer {
|
|||
* @param params the params.
|
||||
*/
|
||||
public static void writeOut(final String message, final Object... params) {
|
||||
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
|
||||
try {
|
||||
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
|
||||
} catch (final RuntimeException ex) {
|
||||
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +52,11 @@ public class Printer {
|
|||
* @param params the params.
|
||||
*/
|
||||
public static void writeErr(final String message, final Object... params) {
|
||||
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
|
||||
try {
|
||||
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
|
||||
} catch (final RuntimeException ex) {
|
||||
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,22 +16,20 @@
|
|||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.xml.transform.URIResolver;
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
|
||||
import de.kosit.validationtool.model.scenarios.ResourceType;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
|
||||
import de.kosit.validationtool.model.scenarios.ResourceType;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
|
||||
import net.sf.saxon.lib.UnparsedTextURIResolver;
|
||||
import net.sf.saxon.s9api.XPathExecutable;
|
||||
import net.sf.saxon.s9api.XPathSelector;
|
||||
|
|
@ -80,7 +78,11 @@ public class Scenario {
|
|||
private Transformation reportTransformation;
|
||||
|
||||
public List<Transformation> getSchematronValidations() {
|
||||
return this.schematronValidations == null ? Collections.emptyList() : this.schematronValidations;
|
||||
// Must return a mutable list
|
||||
if (this.schematronValidations == null) {
|
||||
this.schematronValidations = new ArrayList<>();
|
||||
}
|
||||
return this.schematronValidations;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
@ -95,9 +97,9 @@ public class Scenario {
|
|||
}
|
||||
|
||||
/**
|
||||
* Liefert einen neuen XPath-Selector zur Evaluierung der {@link de.kosit.validationtool.api.AcceptRecommendation}.
|
||||
* Returns a new XPath selector for evaluating the {@link de.kosit.validationtool.api.AcceptRecommendation}.
|
||||
*
|
||||
* @return neuer Selector
|
||||
* @return new selector
|
||||
*/
|
||||
public Optional<XPathSelector> getAcceptSelector() {
|
||||
final XPathSelector selector = this.acceptExecutable != null ? this.acceptExecutable.load() : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue