some cleanup

This commit is contained in:
Andreas Penski 2020-05-03 16:52:55 +02:00
parent 1a001a1af4
commit 7dc62012a6
22 changed files with 144 additions and 50 deletions

View file

@ -64,12 +64,17 @@ public class ConfigurationBuilder {
private String description;
/**
* Add a specific author name to this configuration.
*
* @param authorName the name of the author
* @return this
*/
public ConfigurationBuilder author(final String authorName) {
this.author = authorName;
return this;
}
public ConfigurationBuilder name(final String name) {
this.name = name;
return this;
@ -135,6 +140,12 @@ public class ConfigurationBuilder {
throw new NotImplementedException("Not yet defined");
}
/**
* Create a named schematron configuration.
*
* @param name the name of the schematron configuration
* @return new {@link SchemaBuilder}
*/
public static SchematronBuilder schematron(final String name) {
return new SchematronBuilder().name(name);
}

View file

@ -175,11 +175,27 @@ public class ConfigurationLoader {
return s;
}
/**
* Sets actual {@link ResolvingMode}, when the validator needs to resolve stuff on startup.
* @param mode the resolving mode
* @return this
*/
public ConfigurationLoader setResolvingMode(final ResolvingMode mode) {
this.resolvingMode = mode;
return this;
}
public ConfigurationLoader setResolvingStrategy(final ResolvingConfigurationStrategy strategy){
this.resolvingConfigurationStrategy = strategy;
return this;
}
/**
* Add a parameter to the configuration.
* @param name the name of the parameter
* @param value the parameter value object
* @return this
*/
public ConfigurationLoader addParameter(final String name, final Object value) {
this.parameters.put(name, value);
return this;

View file

@ -13,6 +13,8 @@ import de.kosit.validationtool.model.scenarios.CreateReportType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
/**
* Create a fallback {@link Scenario} configuration.
*
* @author Andreas Penski
*/
public class FallbackBuilder implements Builder<Scenario> {

View file

@ -72,7 +72,7 @@ class XPathBuilder implements Builder<XPathExecutable> {
extractNamespaces();
}
} catch (final IllegalStateException e) {
final String msg = String.format("Error creating %s xpath", this.name, e);
final String msg = String.format("Error creating %s xpath: %s", this.name, e.getMessage());
log.error(msg, e);
return new Result<>(Collections.singletonList(msg));