Commit a0ff9ed7 authored by Matthias Betz's avatar Matthias Betz
Browse files

Added check plugin system

parent 0a7d6299
Pipeline #1380 passed with stage
in 2 minutes and 13 seconds
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -61,10 +63,19 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; ...@@ -61,10 +63,19 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
*/ */
public abstract class Check { public abstract class Check {
private CheckId id; private List<Class<Checkable>> applicableToClasses = new ArrayList<>(2);
public Check(CheckId id) { @SuppressWarnings("unchecked")
this.id = id; public Check() {
Method[] declaredMethods = getClass().getDeclaredMethods();
for (Method m : declaredMethods) {
if ("check".equals(m.getName())) {
Class<?>[] parameterTypes = m.getParameterTypes();
if (parameterTypes.length == 1 && Checkable.class.isAssignableFrom(parameterTypes[0])) {
applicableToClasses.add((Class<Checkable>) parameterTypes[0]);
}
}
}
} }
/** /**
...@@ -72,7 +83,9 @@ public abstract class Check { ...@@ -72,7 +83,9 @@ public abstract class Check {
* *
* @return a list of classes which the check applies to * @return a list of classes which the check applies to
*/ */
public abstract List<Class<? extends Checkable>> getApplicableToClasses(); public List<Class<Checkable>> getApplicableToClasses() {
return applicableToClasses;
}
/** /**
* A list of dependencies which the check depends on. Each of those dependencies * A list of dependencies which the check depends on. Each of those dependencies
...@@ -90,9 +103,7 @@ public abstract class Check { ...@@ -90,9 +103,7 @@ public abstract class Check {
* *
* @return the check id. * @return the check id.
*/ */
public CheckId getCheckId() { public abstract CheckId getCheckId();
return id;
}
/** /**
* Getter for the check type. * Getter for the check type.
...@@ -123,10 +134,10 @@ public abstract class Check { ...@@ -123,10 +134,10 @@ public abstract class Check {
boolean hasError = c.containsError(dependencyCheck); boolean hasError = c.containsError(dependencyCheck);
if (hasError) { if (hasError) {
// check whether a result was already inserted // check whether a result was already inserted
if (!c.hasDependencyNotMetError(id)) { if (!c.hasDependencyNotMetError(getCheckId())) {
// insert dependency error // insert dependency error
CheckError err = new DependenciesNotMetError(dependencyCheck); CheckError err = new DependenciesNotMetError(dependencyCheck);
CheckResult cr = new CheckResult(this.id, ResultStatus.DEPENDENCIES_NOT_MET, err); CheckResult cr = new CheckResult(getCheckId(), ResultStatus.DEPENDENCIES_NOT_MET, err);
c.addCheckResult(cr); c.addCheckResult(cr);
} }
return false; return false;
...@@ -306,7 +317,7 @@ public abstract class Check { ...@@ -306,7 +317,7 @@ public abstract class Check {
@Override @Override
public String toString() { public String toString() {
return "Check [id=" + id + "]"; return "Check [id=" + getCheckId() + "]";
} }
/** /**
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
import de.hft.stuttgart.citydoctor2.datastructure.GmlElement; import de.hft.stuttgart.citydoctor2.datastructure.GmlElement;
...@@ -32,56 +31,29 @@ import de.hft.stuttgart.citydoctor2.datastructure.GmlElement; ...@@ -32,56 +31,29 @@ import de.hft.stuttgart.citydoctor2.datastructure.GmlElement;
* @author Matthias Betz * @author Matthias Betz
* *
*/ */
public abstract class CheckError implements Serializable { public interface CheckError extends Serializable {
private static final long serialVersionUID = -4428235366383090704L;
private ErrorType type;
private ErrorId id;
private GmlElement feature;
/**
* Necessary information for every error type needs to be provided in this
* constructor.
*
* @param id the error id (not null)
* @param type the error type (not null)
* @param feature element in which the error occurred
*/
public CheckError(ErrorId id, ErrorType type, GmlElement feature) {
Objects.requireNonNull(id, "id may not be null");
Objects.requireNonNull(type, "type may not be null");
this.type = type;
this.id = id;
this.feature = feature;
}
/** /**
* Getter for the error type * Getter for the error type
* *
* @return the error type * @return the error type
*/ */
public ErrorType getType() { public ErrorType getType();
return type;
}
/** /**
* Getter for the error id * Getter for the error id
* *
* @return the error id * @return the error id
*/ */
public ErrorId getErrorId() { public ErrorId getErrorId();
return id;
}
/** /**
* The gml feature in which the error occured * The gml feature in which the error occured
* *
* @return the gml feature * @return the gml feature
*/ */
public GmlElement getFeature() { public GmlElement getFeature();
return feature;
}
/** /**
* A general visitor will have a look at this error. Visitor pattern. * A general visitor will have a look at this error. Visitor pattern.
...@@ -89,7 +61,7 @@ public abstract class CheckError implements Serializable { ...@@ -89,7 +61,7 @@ public abstract class CheckError implements Serializable {
* @param errorVisitor the visitor, call {@link ErrorVisitor#visit(CheckError)}) * @param errorVisitor the visitor, call {@link ErrorVisitor#visit(CheckError)})
* on this. * on this.
*/ */
public abstract void accept(ErrorVisitor errorVisitor); public void accept(ErrorVisitor errorVisitor);
/** /**
* Visitor pattern for the healing methods. Call * Visitor pattern for the healing methods. Call
...@@ -100,7 +72,7 @@ public abstract class CheckError implements Serializable { ...@@ -100,7 +72,7 @@ public abstract class CheckError implements Serializable {
* @param l a modification listener when a healing method changes something * @param l a modification listener when a healing method changes something
* @return true if the healing method changed something in the model * @return true if the healing method changed something in the model
*/ */
public abstract boolean accept(HealingMethod method, ModificationListener l); public boolean accept(HealingMethod method, ModificationListener l);
/** /**
* This method functions as interface to various reporting places. The * This method functions as interface to various reporting places. The
...@@ -109,6 +81,6 @@ public abstract class CheckError implements Serializable { ...@@ -109,6 +81,6 @@ public abstract class CheckError implements Serializable {
* *
* @param report * @param report
*/ */
public abstract void report(ErrorReport report); public void report(ErrorReport report);
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY); without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
...@@ -18,57 +18,81 @@ ...@@ -18,57 +18,81 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.util.Collections; import java.io.Serializable;
import java.util.Map;
import java.util.TreeMap;
public enum CheckId { public class CheckId implements Serializable {
C_GE_R_TOO_FEW_POINTS("C_GE_R_TOO_FEW_POINTS"), C_GE_R_NOT_CLOSED("C_GE_R_NOT_CLOSED"), private static final long serialVersionUID = -6267337828874296004L;
C_GE_S_MULTIPLE_CONNECTED_COMPONENTS("C_GE_S_MULTIPLE_CONNECTED_COMPONENTS"),
C_GE_R_DUPLICATE_POINT("C_GE_R_DUPLICATE_POINT"), C_GE_R_SELF_INTERSECTION("C_GE_R_SELF_INTERSECTION"), public static final CheckId C_GE_R_TOO_FEW_POINTS = new CheckId("C_GE_R_TOO_FEW_POINTS");
C_GE_P_INTERIOR_DISCONNECTED("C_GE_P_INTERIOR_DISCONNECTED"), public static final CheckId C_GE_R_NOT_CLOSED = new CheckId("C_GE_R_NOT_CLOSED");
C_GE_P_INTERSECTING_RINGS("C_GE_P_INTERSECTING_RINGS"), C_GE_P_NON_PLANAR("C_GE_P_NON_PLANAR"), public static final CheckId C_GE_S_MULTIPLE_CONNECTED_COMPONENTS = new CheckId(
C_GE_S_TOO_FEW_POLYGONS("C_GE_S_TOO_FEW_POLYGONS"), NULL_AREA("C_GE_R_NULL_AREA"), "C_GE_S_MULTIPLE_CONNECTED_COMPONENTS");
C_GE_S_NOT_CLOSED("C_GE_S_NOT_CLOSED"), C_GE_S_NON_MANIFOLD_EDGE("C_GE_S_NON_MANIFOLD_EDGE"), public static final CheckId C_GE_R_DUPLICATE_POINT = new CheckId("C_GE_R_DUPLICATE_POINT");
C_GE_S_POLYGON_WRONG_ORIENTATION("C_GE_S_POLYGON_WRONG_ORIENTATION"), public static final CheckId C_GE_R_SELF_INTERSECTION = new CheckId("C_GE_R_SELF_INTERSECTION");
C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION("C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION"), public static final CheckId C_GE_P_INTERIOR_DISCONNECTED = new CheckId("C_GE_P_INTERIOR_DISCONNECTED");
C_GE_S_NON_MANIFOLD_VERTEX("C_GE_S_NON_MANIFOLD_VERTEX"), C_GE_S_SELF_INTERSECTION("C_GE_S_SELF_INTERSECTION"), public static final CheckId C_GE_P_INTERSECTING_RINGS = new CheckId("C_GE_P_INTERSECTING_RINGS");
C_GE_P_HOLE_OUTSIDE("C_GE_P_HOLE_OUTSIDE"), C_GE_P_ORIENTATION_RINGS_SAME("C_GE_P_ORIENTATION_RINGS_SAME"), public static final CheckId C_GE_P_NON_PLANAR = new CheckId("C_GE_P_NON_PLANAR");
C_GE_P_INNER_RINGS_NESTED("C_GE_P_INNER_RINGS_NESTED"), IS_CEILING("IS_CEILING"), public static final CheckId C_GE_S_TOO_FEW_POLYGONS = new CheckId("C_GE_S_TOO_FEW_POLYGONS");
C_SEM_F_MISSING_ID("C_SEM_F_MISSING_ID"), C_SEM_BS_NOT_CEILING("C_SEM_BS_NOT_CEILING"), public static final CheckId C_GE_R_NULL_AREA = new CheckId("C_GE_R_NULL_AREA");
C_SEM_BS_NOT_FLOOR("C_SEM_BS_NOT_FLOOR"), C_SEM_BS_NOT_GROUND("C_SEM_BS_NOT_GROUND"), public static final CheckId C_GE_S_NON_MANIFOLD_EDGE = new CheckId("C_GE_S_NON_MANIFOLD_EDGE");
C_SEM_BS_GROUND_NOT_FRAGMENTED("C_SEM_BS_GROUND_NOT_FRAGMENTED"), C_SEM_BS_IS_WALL("C_SEM_BS_IS_WALL"), public static final CheckId C_GE_S_POLYGON_WRONG_ORIENTATION = new CheckId("C_GE_S_POLYGON_WRONG_ORIENTATION");
C_SEM_SCHEMATRON("C_SEM_SCHEMATRON"), C_SEM_BS_ROOF_NOT_FRAGMENTED("C_SEM_BS_ROOF_NOT_FRAGMENTED"); public static final CheckId C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION = new CheckId(
"C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION");
public static final CheckId C_GE_S_NON_MANIFOLD_VERTEX = new CheckId("C_GE_S_NON_MANIFOLD_VERTEX");
public static final CheckId C_GE_S_SELF_INTERSECTION = new CheckId("C_GE_S_SELF_INTERSECTION");
public static final CheckId C_GE_P_HOLE_OUTSIDE = new CheckId("C_GE_P_HOLE_OUTSIDE");
public static final CheckId IS_CEILING = new CheckId("IS_CEILING");
public static final CheckId C_GE_P_INNER_RINGS_NESTED = new CheckId("C_GE_P_INNER_RINGS_NESTED");
public static final CheckId C_SEM_BS_NOT_CEILING = new CheckId("C_SEM_BS_NOT_CEILING");
public static final CheckId C_SEM_BS_NOT_FLOOR = new CheckId("C_SEM_BS_NOT_FLOOR");
public static final CheckId C_SEM_BS_NOT_GROUND = new CheckId("C_SEM_BS_NOT_GROUND");
public static final CheckId C_SEM_F_MISSING_ID = new CheckId("C_SEM_F_MISSING_ID");
public static final CheckId C_SEM_BS_GROUND_NOT_FRAGMENTED = new CheckId("C_SEM_BS_GROUND_NOT_FRAGMENTED");
public static final CheckId C_SEM_BS_IS_WALL = new CheckId("C_SEM_BS_IS_WALL");
public static final CheckId C_SEM_SCHEMATRON = new CheckId("C_SEM_SCHEMATRON");
public static final CheckId C_SEM_BS_ROOF_NOT_FRAGMENTED = new CheckId("C_SEM_BS_ROOF_NOT_FRAGMENTED");
public static final CheckId C_GE_S_NOT_CLOSED = new CheckId("C_GE_S_NOT_CLOSED");
public static final CheckId C_GE_P_ORIENTATION_RINGS_SAME = new CheckId("C_GE_P_ORIENTATION_RINGS_SAME");
private String name;
private static final Map<String, CheckId> ENUM_MAP; public CheckId(String name) {
this.name = name;
static { }
Map<String, CheckId> map = new TreeMap<>();
for (CheckId instance : CheckId.values()) { public String getName() {
map.put(instance.toString().toUpperCase(), instance); return name;
} }
ENUM_MAP = Collections.unmodifiableMap(map);
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
} }
private String id; @Override
public boolean equals(Object obj) {
private CheckId(String id) { if (this == obj)
this.id = id; return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CheckId other = (CheckId) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
} }
@Override @Override
public String toString() { public String toString() {
return id; return name;
} }
/**
* Converts a String to a check id if possible.
*
* @param checkName the string representation of a check
* @return the check id or null if not found.
*/
public static CheckId getIdForName(String checkName) {
return ENUM_MAP.get(checkName.toUpperCase());
}
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serializable; import java.io.Serializable;
import java.util.EnumMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -40,7 +40,7 @@ public abstract class Checkable implements Serializable { ...@@ -40,7 +40,7 @@ public abstract class Checkable implements Serializable {
private static final Logger logger = LogManager.getLogger(Checkable.class); private static final Logger logger = LogManager.getLogger(Checkable.class);
private EnumMap<CheckId, CheckResult> checkResults = new EnumMap<>(CheckId.class); private Map<CheckId, CheckResult> checkResults = new HashMap<>();
private boolean isValidated = false; private boolean isValidated = false;
protected void setValidated(boolean validated) { protected void setValidated(boolean validated) {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serializable;
/** /**
* The error ids of all checks and their respective name, which is used in * The error ids of all checks and their respective name, which is used in
* reports and GUI * reports and GUI
...@@ -25,30 +27,75 @@ package de.hft.stuttgart.citydoctor2.check; ...@@ -25,30 +27,75 @@ package de.hft.stuttgart.citydoctor2.check;
* @author Matthias Betz * @author Matthias Betz
* *
*/ */
public enum ErrorId { public class ErrorId implements Serializable {
DEPENDENCIES_NOT_MET("Dependencies_not_met"), UNKNOWN_ERROR("Unknown_error"), GE_R_NOT_CLOSED("GE_R_NOT_CLOSED"), private static final long serialVersionUID = -2598466667746276560L;
GE_S_MULTIPLE_CONNECTED_COMPONENTS("GE_S_MULTIPLE_CONNECTED_COMPONENTS"),
GE_R_CONSECUTIVE_POINTS_SAME("GE_R_CONSECUTIVE_POINTS_SAME"), GE_R_SELF_INTERSECTION("GE_R_SELF_INTERSECTION"), public static final ErrorId DEPENDENCIES_NOT_MET = new ErrorId("Dependencies_not_met");
GE_S_POLYGON_WRONG_ORIENTATION("GE_S_POLYGON_WRONG_ORIENTATION"), public static final ErrorId UNKNOWN_ERROR = new ErrorId("Unknown_error");
GE_S_ALL_POLYGONS_WRONG_ORIENTATION("GE_S_ALL_POLYGONS_WRONG_ORIENTATION"), GE_P_HOLE_OUTSIDE("GE_P_HOLE_OUTSIDE"), public static final ErrorId GE_R_NOT_CLOSED = new ErrorId("GE_R_NOT_CLOSED");
GE_P_INTERIOR_DISCONNECTED("GE_P_INTERIOR_DISCONNECTED"), GE_S_NON_MANIFOLD_VERTEX("GE_S_NON_MANIFOLD_VERTEX"), public static final ErrorId GE_S_MULTIPLE_CONNECTED_COMPONENTS = new ErrorId("GE_S_MULTIPLE_CONNECTED_COMPONENTS");
GE_P_INNER_RINGS_NESTED("GE_P_INNER_RINGS_NESTED"), GE_R_NULL_AREA("GE_R_NULL_AREA"), public static final ErrorId GE_R_CONSECUTIVE_POINTS_SAME = new ErrorId("GE_R_CONSECUTIVE_POINTS_SAME");
GE_R_TOO_FEW_POINTS("GE_R_TOO_FEW_POINTS"), GE_S_NON_MANIFOLD_EDGE("GE_S_NON_MANIFOLD_EDGE"), public static final ErrorId GE_R_SELF_INTERSECTION = new ErrorId("GE_R_SELF_INTERSECTION");
GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION("GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"), public static final ErrorId GE_S_POLYGON_WRONG_ORIENTATION = new ErrorId("GE_S_POLYGON_WRONG_ORIENTATION");
GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE("GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"), public static final ErrorId GE_S_ALL_POLYGONS_WRONG_ORIENTATION = new ErrorId(
GE_P_ORIENTATION_RINGS_SAME("GE_P_ORIENTATION_RINGS_SAME"), GE_P_INTERSECTING_RINGS("GE_P_INTERSECTION_RINGS"), "GE_S_ALL_POLYGONS_WRONG_ORIENTATION");
GE_S_NOT_CLOSED("GE_S_NOT_CLOSED"), GE_S_SELF_INTERSECTION("GE_S_SELF_INTERSECTION"), public static final ErrorId GE_P_HOLE_OUTSIDE = new ErrorId("GE_P_HOLE_OUTSIDE");
GE_S_TOO_FEW_POLYGONS("GE_S_TOO_FEW_POLYGONS"), SEM_F_MISSING_ID("SEM_F_MISSING_GML_ID"), public static final ErrorId GE_P_INTERIOR_DISCONNECTED = new ErrorId("GE_P_INTERIOR_DISCONNECTED");
SEM_BS_NOT_CEILING("SEM_BS_NOT_CEILING"), SEM_BS_NOT_WALL("SEM_BS_NOT_WALL"), SEM_BS_NOT_FLOOR("SEM_BS_NOT_FLOOR"), public static final ErrorId GE_S_NON_MANIFOLD_VERTEX = new ErrorId("GE_S_NON_MANIFOLD_VERTEX");
SEM_BS_NOT_GROUND("SEM_BS_NOT_GROUND"), SEM_SCHEMATRON_ERROR("SEM_SCHEMATRON_ERROR"), SEM_BS_UNFRAGMENTED("SEM_BS_UNFRAGMENTED"), GE_P_TINY_EDGE("GE_P_TINY_EDGE"); public static final ErrorId GE_P_INNER_RINGS_NESTED = new ErrorId("GE_P_INNER_RINGS_NESTED");
public static final ErrorId GE_R_NULL_AREA = new ErrorId("GE_R_NULL_AREA");
public static final ErrorId GE_R_TOO_FEW_POINTS = new ErrorId("GE_R_TOO_FEW_POINTS");
public static final ErrorId GE_S_NON_MANIFOLD_EDGE = new ErrorId("GE_S_NON_MANIFOLD_EDGE");
public static final ErrorId GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION = new ErrorId(
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION");
public static final ErrorId GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE = new ErrorId(
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE");
public static final ErrorId GE_P_INTERSECTING_RINGS = new ErrorId("GE_P_INTERSECTING_RINGS");
public static final ErrorId GE_S_SELF_INTERSECTION = new ErrorId("GE_S_SELF_INTERSECTION");
public static final ErrorId GE_P_ORIENTATION_RINGS_SAME = new ErrorId("GE_P_ORIENTATION_RINGS_SAME");
public static final ErrorId GE_S_NOT_CLOSED = new ErrorId("GE_S_NOT_CLOSED");
public static final ErrorId GE_S_TOO_FEW_POLYGONS = new ErrorId("GE_S_TOO_FEW_POLYGONS");
public static final ErrorId SEM_F_MISSING_ID = new ErrorId("SEM_F_MISSING_ID");
public static final ErrorId SEM_BS_NOT_CEILING = new ErrorId("SEM_BS_NOT_CEILING");
public static final ErrorId SEM_BS_NOT_WALL = new ErrorId("SEM_BS_NOT_WALL");
public static final ErrorId SEM_BS_NOT_FLOOR = new ErrorId("SEM_BS_NOT_FLOOR");
public static final ErrorId SEM_BS_NOT_GROUND = new ErrorId("SEM_BS_NOT_GROUND");
public static final ErrorId SEM_SCHEMATRON_ERROR = new ErrorId("SEM_SCHEMATRON_ERROR");
public static final ErrorId SEM_BS_UNFRAGMENTED = new ErrorId("SEM_BS_UNFRAGMENTED");
public static final ErrorId GE_P_TINY_EDGE = new ErrorId("GE_P_TINY_EDGE");
private String name; private String name;
private ErrorId(String name) { public ErrorId(String name) {
this.name = name; this.name = name;
} }
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ErrorId other = (ErrorId) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
@Override @Override
public String toString() { public String toString() {
return name; return name;
......
...@@ -26,6 +26,7 @@ import de.hft.stuttgart.citydoctor2.check.ErrorVisitor; ...@@ -26,6 +26,7 @@ import de.hft.stuttgart.citydoctor2.check.ErrorVisitor;
import de.hft.stuttgart.citydoctor2.check.HealingMethod; import de.hft.stuttgart.citydoctor2.check.HealingMethod;
import de.hft.stuttgart.citydoctor2.check.ModificationListener; import de.hft.stuttgart.citydoctor2.check.ModificationListener;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry; import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GmlElement;
/** /**
* Error when all polygons are oriented wrong. * Error when all polygons are oriented wrong.
...@@ -33,14 +34,13 @@ import de.hft.stuttgart.citydoctor2.datastructure.Geometry; ...@@ -33,14 +34,13 @@ import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
* @author Matthias Betz * @author Matthias Betz
* *
*/ */
public class AllPolygonsWrongOrientationError extends CheckError { public class AllPolygonsWrongOrientationError implements CheckError {
private static final long serialVersionUID = 2263993313732858840L; private static final long serialVersionUID = 2263993313732858840L;
private Geometry geom; private Geometry geom;
public AllPolygonsWrongOrientationError(Geometry geom) { public AllPolygonsWrongOrientationError(Geometry geom) {
super(ErrorId.GE_S_ALL_POLYGONS_WRONG_ORIENTATION, ErrorType.ERROR, geom);