Commit 97a65114 authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.15.0

See merge request !8
parents 99c8f6a8 5950ea5f
Pipeline #10106 passed with stage
in 3 minutes and 15 seconds
......@@ -18,6 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
......@@ -34,6 +35,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
*/
public class IncludeFilterConfiguration implements Serializable {
@Serial
private static final long serialVersionUID = 1840264505629236113L;
private List<FeatureType> types;
......
......@@ -24,7 +24,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
public class PatternFilter implements Filter {
private Pattern pattern;
private final Pattern pattern;
public PatternFilter(String patternString) {
pattern = Pattern.compile(patternString);
......
......@@ -18,6 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
......@@ -31,6 +32,7 @@ import java.util.Map;
*/
public class RequirementConfiguration implements Serializable {
@Serial
private static final long serialVersionUID = -1258195428669813888L;
private boolean enabled;
......
......@@ -63,22 +63,22 @@ public class StreamCityGmlConsumer implements CityGmlConsumer {
private static final Logger logger = LogManager.getLogger(StreamCityGmlConsumer.class);
private Checker c;
private XmlStreamReporter xmlReporter;
private PdfStreamReporter pdfReporter;
private SvrlContentHandler handler;
private Map<ErrorId, AtomicInteger> errorCount;
private GeometryFactory gmlFactory;
private ValidationConfiguration config;
private Statistics statistics;
private FeatureStatistics buildingStatistics;
private FeatureStatistics bridgeStatistics;
private FeatureStatistics transportationStatistics;
private FeatureStatistics vegetationStatistics;
private FeatureStatistics landStatistics;
private FeatureStatistics waterStatistics;
private Validation val;
private FeatureCheckedListener l;
private final Checker c;
private final XmlStreamReporter xmlReporter;
private final PdfStreamReporter pdfReporter;
private final SvrlContentHandler handler;
private final Map<ErrorId, AtomicInteger> errorCount;
private final GeometryFactory gmlFactory;
private final ValidationConfiguration config;
private final Statistics statistics;
private final FeatureStatistics buildingStatistics;
private final FeatureStatistics bridgeStatistics;
private final FeatureStatistics transportationStatistics;
private final FeatureStatistics vegetationStatistics;
private final FeatureStatistics landStatistics;
private final FeatureStatistics waterStatistics;
private final Validation val;
private final FeatureCheckedListener l;
public StreamCityGmlConsumer(Checker c, XmlStreamReporter xmlReporter, PdfStreamReporter pdfReporter,
SvrlContentHandler handler, ValidationConfiguration config, FeatureCheckedListener l) {
......@@ -92,7 +92,7 @@ public class StreamCityGmlConsumer implements CityGmlConsumer {
gmlFactory = GeometryFactory.newInstance();
val = new Validation();
val.setId("CD" + UUID.randomUUID().toString());
val.setId("CD" + UUID.randomUUID());
val.setValidationDate(ZonedDateTime.now());
val.setValidationSoftware("CityDoctor " + Localization.getText(Localization.VERSION));
statistics = new Statistics();
......@@ -182,7 +182,7 @@ public class StreamCityGmlConsumer implements CityGmlConsumer {
}
val.setStatistics(new StatisticsProperty(statistics));
ValidationPlan validationPlan = c.createValidationPlan();
validationPlan.setId("CD_PLAN_" + UUID.randomUUID().toString());
validationPlan.setId("CD_PLAN_" + UUID.randomUUID());
cm.getFeatureMembers().add(new AbstractFeatureProperty(validationPlan));
val.setValidationPlan(new Reference(validationPlan));
......
......@@ -21,27 +21,28 @@ package de.hft.stuttgart.citydoctor2.check;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
/**
* Filters the feature type of features
*
* @author Matthias Betz
*
* @author Matthias Betz
*/
public class TypeFilter implements Filter {
private FeatureType type;
private final FeatureType type;
public TypeFilter(FeatureType type) {
this.type = type;
}
@Override
public boolean matches(CityObject co) {
return co.getFeatureType() == type;
}
public TypeFilter(FeatureType type) {
this.type = type;
}
public FeatureType getType() {
return type;
}
@Override
public boolean matches(CityObject co) {
return co.getFeatureType() == type;
}
}
......@@ -18,14 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
......@@ -33,6 +26,7 @@ import java.util.Map.Entry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.nodes.Tag;
......@@ -55,6 +49,7 @@ public class ValidationConfiguration implements Serializable {
public static final String CHECK_FOR_SOLID_XML = "checkForSolid.xml";
private static final String NUMBER_OF_ROUNDING_PLACES_DEFAULT = "8";
private static final String MIN_VERTEX_DISTANCE_DEFAULT = "0.0001";
@Serial
private static final long serialVersionUID = -8020055032177740646L;
private static final Logger logger = LogManager.getLogger(ValidationConfiguration.class);
......@@ -72,7 +67,7 @@ public class ValidationConfiguration implements Serializable {
}
public static ValidationConfiguration loadValidationConfig(InputStream stream) {
Yaml yaml = new Yaml(new Constructor(ValidationConfiguration.class));
Yaml yaml = new Yaml(new Constructor(ValidationConfiguration.class, new LoaderOptions()));
ValidationConfiguration config = yaml.load(stream);
config.validateConfiguration();
return config;
......@@ -104,9 +99,9 @@ public class ValidationConfiguration implements Serializable {
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setPrettyFlow(true);
Representer rep = new ValidationConfigurationRepresenter();
Representer rep = new ValidationConfigurationRepresenter(options);
rep.addClassTag(ValidationConfiguration.class, Tag.MAP);
Yaml yaml = new Yaml(rep, options);
Yaml yaml = new Yaml(rep);
try (BufferedWriter bw = new BufferedWriter(new FileWriter(f))) {
yaml.dump(this, bw);
}
......@@ -178,9 +173,9 @@ public class ValidationConfiguration implements Serializable {
return cConfig;
});
}
globalParameters.computeIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, k -> MIN_VERTEX_DISTANCE_DEFAULT);
globalParameters.computeIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES,
k -> NUMBER_OF_ROUNDING_PLACES_DEFAULT);
globalParameters.putIfAbsent(GlobalParameters.MIN_VERTEX_DISTANCE, MIN_VERTEX_DISTANCE_DEFAULT);
globalParameters.putIfAbsent(GlobalParameters.NUMBER_OF_ROUNDING_PLACES,
NUMBER_OF_ROUNDING_PLACES_DEFAULT);
}
public int getNumberOfRoundingPlaces() {
......
......@@ -18,6 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.introspector.Property;
import org.yaml.snakeyaml.nodes.CollectionNode;
import org.yaml.snakeyaml.nodes.MappingNode;
......@@ -35,7 +36,11 @@ import org.yaml.snakeyaml.representer.Representer;
*
*/
public class ValidationConfigurationRepresenter extends Representer {
public ValidationConfigurationRepresenter(DumperOptions options) {
super(options);
}
@Override
protected NodeTuple representJavaBeanProperty(Object javaBean, Property property, Object propertyValue,
Tag customTag) {
......
......@@ -38,7 +38,7 @@ import de.hft.stuttgart.citydoctor2.check.RequirementType;
*/
public class CheckPrototype {
private Check c;
private final Check c;
public CheckPrototype(Check c) {
this.c = c;
......
......@@ -69,12 +69,12 @@ public class Checks {
private static final Logger logger = LogManager.getLogger(Checks.class);
private static List<CheckPrototype> checkPrototypes;
private static Map<CheckId, CheckPrototype> prototypeMap;
private static final List<CheckPrototype> checkPrototypes;
private static final Map<CheckId, CheckPrototype> prototypeMap;
private static Map<String, Requirement> availableRequirements;
private Map<CheckId, Check> checkMap;
private final Map<CheckId, Check> checkMap;
static {
checkPrototypes = new ArrayList<>();
......
......@@ -45,8 +45,8 @@ public class SvrlContentHandler implements ContentHandler {
private StringBuilder buffer;
private Map<String, List<SchematronError>> featureErrors;
private List<SchematronError> generalErrors;
private final Map<String, List<SchematronError>> featureErrors;
private final List<SchematronError> generalErrors;
public SvrlContentHandler() {
featureErrors = new HashMap<>();
......@@ -65,22 +65,23 @@ public class SvrlContentHandler implements ContentHandler {
public void setDocumentLocator(Locator locator) {
// not needed
}
@SuppressWarnings("RedundantThrows")
@Override
public void startDocument() throws SAXException {
// not needed
}
@Override
@SuppressWarnings("RedundantThrows")
@Override
public void endDocument() throws SAXException {
// not needed
}
@SuppressWarnings("RedundantThrows")
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
// not needed
}
@SuppressWarnings("RedundantThrows")
@Override
public void endPrefixMapping(String prefix) throws SAXException {
// not needed
......@@ -132,17 +133,17 @@ public class SvrlContentHandler implements ContentHandler {
buffer.append(ch, start, length);
}
}
@SuppressWarnings("RedundantThrows")
@Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
// not needed
}
@SuppressWarnings("RedundantThrows")
@Override
public void processingInstruction(String target, String data) throws SAXException {
// not needed
}
@SuppressWarnings("RedundantThrows")
@Override
public void skippedEntity(String name) throws SAXException {
// not needed
......
......@@ -124,9 +124,9 @@ public class RingSelfIntCheck extends Check {
Segment3d s1 = new Segment3d(e1.getFrom(), e1.getTo());
Segment3d s2 = new Segment3d(e2.getFrom(), e2.getTo());
DistanceResult dr = s1.getDistanceResult(s2);
if (dr.getDistance() < epsilon) {
if (dr.distance() < epsilon) {
// intersection
CheckError err = new RingEdgeIntersectionError(lr, e1, e2, dr.getPoint1());
CheckError err = new RingEdgeIntersectionError(lr, e1, e2, dr.point1());
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
lr.addCheckResult(cr);
return;
......
......@@ -26,6 +26,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
* @author Matthias Betz
*
*/
@FunctionalInterface
public interface FeatureCheckedListener {
public void featureChecked(CityObject co);
......
......@@ -78,7 +78,7 @@ public class SelfIntersectionUtil {
private static final Logger logger = LogManager.getLogger(SelfIntersectionUtil.class);
private static GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING));
private static final GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING));
private SelfIntersectionUtil() {
......@@ -93,7 +93,7 @@ public class SelfIntersectionUtil {
List<PolygonIntersection> intersections = new ArrayList<>();
MeshSurface meshSurface = MeshSurface.of(g);
Map<Polygon, EdgePolygon> edgePolyMap = new IdentityHashMap<>();
for (EdgePolygon poly : meshSurface.getPolygons()) {
for (EdgePolygon poly : meshSurface.polygons()) {
edgePolyMap.put(poly.getOriginal(), poly);
}
for (int i = 0; i < polygons.size() - 1; i++) {
......@@ -213,12 +213,10 @@ public class SelfIntersectionUtil {
// intersection is only an edge, not a polygon
// edge intersections are allowed
return PolygonIntersection.none();
} else if (intersection instanceof GeometryCollection) {
GeometryCollection col = (GeometryCollection) intersection;
} else if (intersection instanceof GeometryCollection col) {
for (int i = 0; i < col.getNumGeometries(); i++) {
org.locationtech.jts.geom.Geometry interGeom = col.getGeometryN(i);
if (interGeom instanceof org.locationtech.jts.geom.Polygon) {
org.locationtech.jts.geom.Polygon intPoly = (org.locationtech.jts.geom.Polygon) interGeom;
if (interGeom instanceof org.locationtech.jts.geom.Polygon intPoly) {
ConcretePolygon poly = convertToPolygon(plane1, projectionAxis, intPoly);
return PolygonIntersection.polygon(poly, p1.getOriginal(), p2.getOriginal());
}
......@@ -226,8 +224,7 @@ public class SelfIntersectionUtil {
// no polygon in collection, so no intersection
return PolygonIntersection.none();
}
if (intersection instanceof org.locationtech.jts.geom.Polygon) {
org.locationtech.jts.geom.Polygon intPoly = (org.locationtech.jts.geom.Polygon) intersection;
if (intersection instanceof org.locationtech.jts.geom.Polygon intPoly) {
ConcretePolygon poly = convertToPolygon(plane1, projectionAxis, intPoly);
return PolygonIntersection.polygon(poly, p1.getOriginal(), p2.getOriginal());
} else {
......@@ -412,7 +409,7 @@ public class SelfIntersectionUtil {
Triangle3d t2 = p2.getTriangles().get(p2Index);
if (t1.doesIntersect(t2)) {
logger.trace("{} intersects {}", t1, t2);
logger.trace("{} intersects {}", t1.getPartOf().getOriginal().getGmlId(),
logger.trace("GML-ID: {} intersects {}", t1.getPartOf().getOriginal().getGmlId(),
t2.getPartOf().getOriginal().getGmlId());
return new GeometrySelfIntersection(t1.getPartOf().getOriginal(), t2.getPartOf().getOriginal(), t1,
t2);
......
......@@ -52,22 +52,20 @@ public class ArgumentParser {
HashMap<String, List<String>> params = new HashMap<>();
List<String> options = null;
for (int i = 0; i < args.length; i++) {
final String a = args[i];
if (a.charAt(0) == '-') {
if (a.length() < 2) {
ErrorHandler.printHelpAndTerminate("Error while parsing argument " + a);
}
String flag = a.substring(1).toLowerCase();
options = new ArrayList<>();
params.put(flag, options);
} else if (options != null) {
options.add(a);
} else {
ErrorHandler.printHelpAndTerminate("Illegal parameter usage at " + a);
}
}
for (final String a : args) {
if (a.charAt(0) == '-') {
if (a.length() < 2) {
ErrorHandler.printHelpAndTerminate("Error while parsing argument " + a);
}
String flag = a.substring(1).toLowerCase();
options = new ArrayList<>();
params.put(flag, options);
} else if (options != null) {
options.add(a);
} else {
ErrorHandler.printHelpAndTerminate("Illegal parameter usage at " + a);
}
}
return params;
}
......
......@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
public class ErrorStatisticsCollector {
private Map<String, AtomicInteger> errorCounts = new HashMap<>();
private final Map<String, AtomicInteger> errorCounts = new HashMap<>();
public void addError(String errorName) {
AtomicInteger numErrors = errorCounts.get(errorName);
......
......@@ -56,8 +56,8 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
*/
public class XmlStreamErrorHandler implements ErrorReport {
private ErrorDetails details;
private BasicCoordinateTransform originalTransform;
private final ErrorDetails details;
private final BasicCoordinateTransform originalTransform;
public XmlStreamErrorHandler(ParserConfiguration config) {
originalTransform = config.getOriginalTransform();
......
......@@ -74,11 +74,11 @@ public class XmlStreamReporter implements StreamReporter {
private static final Logger logger = LogManager.getLogger(XmlStreamReporter.class);
private OutputStream output;
private final OutputStream output;
private CheckReport report;
private Map<String, FeatureReport> reportMap;
private ValidationConfiguration config;
private final CheckReport report;
private final Map<String, FeatureReport> reportMap;
private final ValidationConfiguration config;
public XmlStreamReporter(OutputStream output, String fileName, ValidationConfiguration config) {
this.output = output;
......@@ -141,18 +141,18 @@ public class XmlStreamReporter implements StreamReporter {
@Override
public void report(CityObject co) {
if (co instanceof Building) {
reportBuilding((Building) co);
} else if (co instanceof Vegetation) {
reportVegetation((Vegetation) co);
} else if (co instanceof TransportationObject) {
reportTrans((TransportationObject) co);
} else if (co instanceof BridgeObject) {
reportBridge((BridgeObject) co);
} else if (co instanceof WaterObject) {
reportWater((WaterObject) co);
} else if (co instanceof LandObject) {
reportLand((LandObject) co);
if (co instanceof Building bu) {
reportBuilding(bu);
} else if (co instanceof Vegetation ve) {
reportVegetation(ve);
} else if (co instanceof TransportationObject to) {
reportTrans(to);
} else if (co instanceof BridgeObject bo) {
reportBridge(bo);
} else if (co instanceof WaterObject wo) {
reportWater(wo);
} else if (co instanceof LandObject lo) {
reportLand(lo);
} else {
throw new IllegalStateException("Not reportable CityObject found: " + co.getClass().getSimpleName());
}
......@@ -240,26 +240,10 @@ public class XmlStreamReporter implements StreamReporter {
@Override
public void finishReport() throws CheckReportWriteException {
GlobalStatistics stats = new GlobalStatistics();
GlobalErrorStatistics globErrStats = new GlobalErrorStatistics();
globErrStats
.setNumErrorBridgeObjects(getNumberOfErrorFeatures(report.getValidationResults().getBridgeReports()));
globErrStats.setNumErrorBuildings(getNumberOfErrorFeatures(report.getValidationResults().getBuildingReports()));
globErrStats.setNumErrorLandObjects(getNumberOfErrorFeatures(report.getValidationResults().getLandReports()));
globErrStats.setNumErrorTransportation(
getNumberOfErrorFeatures(report.getValidationResults().getTransportationReports()));
globErrStats
.setNumErrorVegetation(getNumberOfErrorFeatures(report.getValidationResults().getVegetationReports()));
globErrStats.setNumErrorWaterObjects(getNumberOfErrorFeatures(report.getValidationResults().getWaterReports()));
stats.setGlobalErrorStats(globErrStats);
ModelStatistics modelStats = new ModelStatistics();
modelStats.setNumBridgeObjects(report.getValidationResults().getBridgeReports().size());
modelStats.setNumBuildings(report.getValidationResults().getBuildingReports().size());
modelStats.setNumLandObjects(report.getValidationResults().getLandReports().size());
modelStats.setNumTransportation(report.getValidationResults().getTransportationReports().size());
modelStats.setNumVegetation(report.getValidationResults().getVegetationReports().size());
modelStats.setNumWaterObjects(report.getValidationResults().getWaterReports().size());
stats.setModelStats(modelStats);
stats.setGlobalErrorStats(getReportGlobalErrorStatistics());
stats.setModelStats(getReportModelStatistics());
ErrorStatisticsCollector globalErrorCount = new ErrorStatisticsCollector();
......@@ -279,6 +263,31 @@ public class XmlStreamReporter implements StreamReporter {
report.saveAs(output);
}
private ModelStatistics getReportModelStatistics() {
ModelStatistics modelStats = new ModelStatistics();
modelStats.setNumBridgeObjects(report.getValidationResults().getBridgeReports().size());
modelStats.setNumBuildings(report.getValidationResults().getBuildingReports().size());
modelStats.setNumLandObjects(report.getValidationResults().getLandReports().size());
modelStats.setNumTransportation(report.getValidationResults().getTransportationReports().size());
modelStats.setNumVegetation(report.getValidationResults().getVegetationReports().size());
modelStats.setNumWaterObjects(report.getValidationResults().getWaterReports().size());
return modelStats;
}
private GlobalErrorStatistics getReportGlobalErrorStatistics() {
GlobalErrorStatistics globErrStats = new GlobalErrorStatistics();
globErrStats
.setNumErrorBridgeObjects(getNumberOfErrorFeatures(report.getValidationResults().getBridgeReports()));
globErrStats.setNumErrorBuildings(getNumberOfErrorFeatures(report.getValidationResults().getBuildingReports()));
globErrStats.setNumErrorLandObjects(getNumberOfErrorFeatures(report.getValidationResults().getLandReports()));
globErrStats.setNumErrorTransportation(
getNumberOfErrorFeatures(report.getValidationResults().getTransportationReports()));
globErrStats
.setNumErrorVegetation(getNumberOfErrorFeatures(report.getValidationResults().getVegetationReports()));
globErrStats.setNumErrorWaterObjects(getNumberOfErrorFeatures(report.getValidationResults().getWaterReports()));
return globErrStats;
}
private void createStatistics(ErrorStatisticsCollector globalErrorCount, List<FeatureReport> reports) {
for (FeatureReport fReport : reports) {
if (fReport.getErrors().isEmpty()) {
......
......@@ -31,8 +31,8 @@ public class CodeBlock {
private static final String BLOCK = "block";
private Element codeBlockContainer;
private Element codeBlockElement;
private final Element codeBlockContainer;
private final Element codeBlockElement;
private Element currentLine;
......
......@@ -48,8 +48,8 @@ public class PdfErrorHandler implements ErrorReport {
private static final String ATTRIBUTE_KEY_COLOR = "#7F007F";
private static final String ATTRIBUTE_VALUE_COLOR = "#2A00FF";
private Section section;
private ParserConfiguration config;
private final Section section;
private final ParserConfiguration config;
public PdfErrorHandler(Section section, ParserConfiguration config) {
this.config = config;
......
......@@ -72,14 +72,14 @@ public class PdfStreamReporter implements StreamReporter {
private static final String WARNING_COLOR = "yellow";
private static final String OK_COLOR = "green";
private PdfReport report;
private OutputStream outFile;
private final PdfReport report;
private final OutputStream outFile;
private Map<ErrorId, AtomicInteger> errorStatistics;
private ValidationConfiguration config;
private final Map<ErrorId, AtomicInteger> errorStatistics;
private final ValidationConfiguration config;
private Section statistics;
private Section vr;
private final Section statistics;
private final Section vr;
private Section buildings;
private int numErrorBuildings;
......@@ -107,7 +107,7 @@ public class PdfStreamReporter implements StreamReporter {
private Section globalErrors;
private Map<String, Section> sectionMap = new HashMap<>();
private final Map<String, Section> sectionMap = new HashMap<>();
public PdfStreamReporter(OutputStream pdfOutputFile, String fileName, ValidationConfiguration config) {
this.config = config;
......@@ -393,21 +393,7 @@ public class PdfStreamReporter implements StreamReporter {
@Override
public void finishReport() throws CheckReportWriteException {
if (buildings != null) {
for (Section s : buildings.getSubSections()) {
if (!s.hasErrors()) {
numOkBuildings++;
// building has no errors, no table
continue;
}
numErrorBuildings++;
Table t = new Table(2);
t.setTableColumnWidth(75, 25);
t.setTitle("Error", "Count");
for (Entry<String, AtomicInteger> e : s.getStats().getErrorCounts().entrySet()) {
t.addRow(e.getKey(), e.getValue().toString());
}
s.addTable(1, t);
}
countFinishedReportBuildings();
}
int numBuildings = numErrorBuildings + numOkBuildings;
if (numBuildings > 0) {
......@@ -446,6 +432,24 @@ public class PdfStreamReporter implements StreamReporter {
report.save(outFile);
}
private void countFinishedReportBuildings() {
for (Section s : buildings.getSubSections()) {
if (!s.hasErrors()) {
numOkBuildings++;
// building has no errors, no table
continue;
}
numErrorBuildings++;
Table t = new Table(2);
t.setTableColumnWidth(75, 25);
t.setTitle("Error", "Count");
for (Entry<String, AtomicInteger> e : s.getStats().getErrorCounts().entrySet()) {
t.addRow(e.getKey(), e.getValue().toString());
}
s.addTable(1, t);
}
}
@Override
public void reportGlobalError(CheckError err) {
AtomicInteger errorCount = errorStatistics.computeIfAbsent(err.getErrorId(), k -> new AtomicInteger(0));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment