01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.validation;
16:
17: import org.geotools.feature.FeatureType;
18: import org.geotools.validation.FeatureValidation;
19: import org.geotools.validation.spatial.LineNoSelfOverlappingValidation;
20:
21: import com.vividsolutions.jts.geom.LineString;
22:
23: /**
24: * Overrides the FeatureValidationOp abstract class and returns the appropriate validation method for the
25: * validation type.
26: * <p>
27: * </p>
28: *
29: * @author chorner
30: * @since 1.0.1
31: */
32: public class ValidateLineNoSelfOverlapping extends FeatureValidationOp {
33: public FeatureValidation getValidator() {
34: return new LineNoSelfOverlappingValidation();
35: }
36:
37: @Override
38: protected boolean canValidate(FeatureType featureType) {
39: if (featureType.getDefaultGeometry() instanceof LineString) {
40: return true;
41: }
42: return false;
43: }
44:
45: }
|