Skip to content
Snippets Groups Projects
Commit 1467f573 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- encapsulating debug output

parent e837cef0
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,18 @@ import java.util.List;
class ValidationCatalogResolver implements CatalogResolver {
private final String[] catalogs;
private final List<String> errors;
ValidationCatalogResolver(String[] catalogs, List<String> errors) {
private boolean debug = false;
ValidationCatalogResolver(String[] catalogs, List<String> errors, boolean debug) {
this.catalogs = catalogs;
this.errors = errors;
this.debug = debug;
}
@Override
public InputSource resolveEntity(String publicId, String systemId) {
System.out.println("======");
System.out.println("resolveEntity publicId=" + publicId + " systemId=" + systemId);
if (debug) {
System.out.println("======");
System.out.println("resolveEntity publicId=" + publicId + " systemId=" + systemId);
}
if (catalogs.length == 0) {
//System.out.println("No catalog given!");
errors.add("No catalog given!");
......@@ -35,7 +39,9 @@ class ValidationCatalogResolver implements CatalogResolver {
cr.setCatalogList(catalogs);
result = cr.resolveEntity(publicId, systemId);
} catch (IOException | CatalogException | SAXException e) {
System.out.println("No mapping found for publicId=" + publicId + ", systemId=" + systemId + ", " + e.getMessage());
if (debug) {
System.out.println("No mapping found for publicId=" + publicId + ", systemId=" + systemId + ", " + e.getMessage());
}
errors.add("No mapping found for publicId=" + publicId + ", systemId=" + systemId + ", " + e.getMessage());
}
return result;
......@@ -43,23 +49,28 @@ class ValidationCatalogResolver implements CatalogResolver {
@Override
public Source resolve(String href, String base) {
System.out.println("======");
System.out.println("resolve href=" + href + " base=" + base);
if (debug) {
System.out.println("======");
System.out.println("resolve href=" + href + " base=" + base);
}
return null;
}
@Override
public InputStream resolveEntity(String publicId, String systemId, String baseUri, String nameSpace) {
System.out.println("======");
System.out.println("resolveEntity2 publicId=" + publicId + " systemId=" + systemId);
if (debug) {
System.out.println("======");
System.out.println("resolveEntity2 publicId=" + publicId + " systemId=" + systemId);
}
return null;
}
@Override
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseUri) {
System.out.println("======");
System.out.println("resolveResource publicId=" + publicId + " systemId=" + systemId);
if (debug) {
System.out.println("======");
System.out.println("resolveResource publicId=" + publicId + " systemId=" + systemId);
}
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment