01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on Jan 22, 2004
17: */
18: package org.geotools.validation.spatial;
19:
20: import java.beans.IntrospectionException;
21: import java.beans.PropertyDescriptor;
22: import java.util.ResourceBundle;
23:
24: import org.geotools.validation.DefaultIntegrityValidationBeanInfo;
25:
26: /**
27: * LineAbstractValidationBeanInfopurpose.
28: *
29: * <p>
30: * Description of LineAbstractValidationBeanInfo...
31: * </p>
32: *
33: * @author dzwiers, Refractions Research, Inc.
34: * @author $Author: dmzwiers $ (last modification)
35: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/spatial/LineLineAbstractValidationBeanInfo.java $
36: * @version $Id: LineLineAbstractValidationBeanInfo.java 22266 2006-10-19 11:30:55Z acuster $
37: */
38: public class LineLineAbstractValidationBeanInfo extends
39: DefaultIntegrityValidationBeanInfo {
40: /**
41: * LineAbstractValidationBeanInfoconstructor.
42: *
43: * <p>
44: * Description
45: * </p>
46: */
47: public LineLineAbstractValidationBeanInfo() {
48: super ();
49: }
50:
51: /**
52: * Implementation of getPropertyDescriptors.
53: *
54: *
55: * @see java.beans.BeanInfo#getPropertyDescriptors()
56: */
57: public PropertyDescriptor[] getPropertyDescriptors() {
58: PropertyDescriptor[] pd2 = super .getPropertyDescriptors();
59: ResourceBundle resourceBundle = getResourceBundle(LineLineAbstractValidation.class);
60:
61: if (pd2 == null) {
62: pd2 = new PropertyDescriptor[0];
63: }
64:
65: PropertyDescriptor[] pd = new PropertyDescriptor[pd2.length + 2];
66: int i = 0;
67:
68: for (; i < pd2.length; i++)
69: pd[i] = pd2[i];
70:
71: try {
72: pd[i] = createPropertyDescriptor("lineTypeRef",
73: LineLineAbstractValidation.class, resourceBundle);
74: pd[i].setExpert(false);
75: pd[i + 1] = createPropertyDescriptor(
76: "restrictedLineTypeRef",
77: LineLineAbstractValidation.class, resourceBundle);
78: pd[i + 1].setExpert(false);
79: } catch (IntrospectionException e) {
80: pd = pd2;
81:
82: // TODO error, log here
83: e.printStackTrace();
84: }
85:
86: return pd;
87: }
88: }
|