Commit 59e8a24d authored by Riegel's avatar Riegel
Browse files

Code cleaning. Ref #69

parent d06f29ab
......@@ -43,7 +43,6 @@ import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
......@@ -131,7 +130,6 @@ public class Checker {
* given or this checker has not validated anything, nothing is done.
*
* @param xmlOutput the output file location for the XML report. Can be null.
* @param model the model for which the report is written.
*/
public void writeXmlReport(String xmlOutput) {
if (!model.isValidated() || xmlOutput == null) {
......@@ -437,13 +435,7 @@ public class Checker {
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
transformerFactory.setURIResolver(new URIResolver() {
@Override
public Source resolve(String href, String base) throws TransformerException {
return new StreamSource(Checker.class.getResourceAsStream(href));
}
});
transformerFactory.setURIResolver((href, base) -> new StreamSource(Checker.class.getResourceAsStream(href)));
Source dsdlXslSource = new StreamSource(Checker.class.getResourceAsStream("iso_dsdl_include.xsl"));
Transformer dsdlXslTransformer = transformerFactory.newTransformer(dsdlXslSource);
......
......@@ -27,6 +27,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
* @author Matthias Betz
*
*/
@FunctionalInterface
public interface Filter {
/**
......
......@@ -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));
......
......@@ -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;
......
......@@ -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
......
......@@ -26,6 +26,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
* @author Matthias Betz
*
*/
@FunctionalInterface
public interface FeatureCheckedListener {
public void featureChecked(CityObject co);
......
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